com.phoenix_int.aserver.util
Class Hierarchy
java.util.Enumeration
StringTokenizer. Using the StringTokenizer source as a starting point, the source code was modified to recognize quoted strings as separate tokens.
The following is one example of the use of the tokenizer. The code:
Constructor Summary
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail
PHXStringTokenizer
delim argument are the delimiters for separating tokens. If the returnTokens flag is true, then the delimiter characters are also returned as tokens. Each delimiter is returned as a string of length 1. If the flag is false, the delimiter characters are skipped and only serve as separators between tokens.
Parameters:
str- a string to be parsed.delim- the delimiters.
java.lang.IllegalArgumentException- thrown if"is specified as a delimiter
PHXStringTokenizer
delim argument are the delimiters for separating tokens. If the returnTokens flag is true, then the delimiter characters are also returned as tokens. Each delimiter is returned as a string of length 1. If the flag is false, the delimiter characters are skipped and only serve as separators between tokens.
Parameters:
str- a string to be parsed.delim- the delimiters.doUnslash- Whether to unslash slashed characters (\n)
java.lang.IllegalArgumentException- thrown if"is specified as a delimiter
PHXStringTokenizer
delim argument are the delimiters for separating tokens. If the returnTokens flag is true, then the delimiter characters are also returned as tokens. Each delimiter is returned as a string of length 1. If the flag is false, the delimiter characters are skipped and only serve as separators between tokens.
Parameters:
str- a string to be parsed.delim- the delimiters.
java.lang.IllegalArgumentException- thrown if"is specified as a delimiter
PHXStringTokenizer
delim argument are the delimiters for separating tokens. If the returnTokens flag is true, then the delimiter characters are also returned as tokens. Each delimiter is returned as a string of length 1. If the flag is false, the delimiter characters are skipped and only serve as separators between tokens.
Parameters:
str- a string to be parsed.delim- the delimiters.doUnslash- Whether to unslash slashed characters (\n)
java.lang.IllegalArgumentException- thrown if"is specified as a delimiter
PHXStringTokenizer
"\t\n\r": the space character, the tab character, the newline character, and the carriage-return character.
Parameters:
str- a string to be parsed.
PHXStringTokenizer
"\t\n\r": the space character, the tab character, the newline character, and the carriage-return character.
Parameters:
str- a string to be parsed.doUnslash- Whether to unslash slashed characters (\n)
PHXStringTokenizer
"\t\n\r": the space character, the tab character, the newline character, and the carriage-return character.
Parameters:
str- a string to be parsed.
PHXStringTokenizer
"\t\n\r": the space character, the tab character, the newline character, and the carriage-return character.
Parameters:
str- a string to be parsed.doUnslash- Whether to unslash slashed characters (\n)
Method Detail
setQuoteChar
c- the quote character
getCurrentPosition
skipDelimiters
wasLastTokenQuoted
trueorfalse
hasMoreTokens
trueif there are more tokens available from this tokenizer’s string;falseotherwise.
getRemainder
nextToken())
Returns:
- the remainder of the untokenized string
getRemainder2
nextToken())
Returns:
- the remainder of the untokenized string
nextToken
- the next token from this string tokenizer.
java.util.NoSuchElementException- if there are no more tokens in this tokenizer’s string.
nextToken2
- the next token from this string tokenizer.
java.util.NoSuchElementException- if there are no more tokens in this tokenizer’s string.
nextToken2
returnValue- if false, the value returned is always null
- the next token from this string tokenizer.
java.util.NoSuchElementException- if there are no more tokens in this tokenizer’s string.
nextToken
delim- the new delimiters.
- the next token, after switching to the new delimiter set.
java.util.NoSuchElementException- if there are no more tokens in this tokenizer’s string.java.lang.IllegalArgumentException- thrown if"is specified as a delimeter
nextToken2
delim- the new delimiters.
- the next token, after switching to the new delimiter set.
java.util.NoSuchElementException- if there are no more tokens in this tokenizer’s string.java.lang.IllegalArgumentException- thrown if"is specified as a delimeter
hasMoreElements
hasMoreTokens method. It exists so that this class can implement the Enumeration interface.
Specified by:
hasMoreElementsin interfacejava.util.Enumeration
trueif there are more tokens;falseotherwise.
nextElement
nextToken method, except that its declared return value is Object rather than String. It exists so that this class can implement the Enumeration interface.
Specified by:
nextElementin interfacejava.util.Enumeration
- the next token in the string.
java.util.NoSuchElementException- if there are no more tokens in this tokenizer’s string.
countTokens
nextToken method can be called before it generates an exception.
Returns:
- the number of tokens remaining in the string using the current delimiter set.