|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.xbill.DNS.utils.MyStringTokenizer
A class similar to StringTokenizer, with a few differences making it more suitable. The \ character is used as an escape character, allowing delimiters to be escaped and \xxx decimal value to be used. Quoted strings (delimited by double quotes) are treated as one token.
| Constructor Summary | |
MyStringTokenizer(String _s)
Creates a new instance of MyStringTokenizer, with whitespace delimiters (space, tab, newline). |
|
MyStringTokenizer(String _s,
String _delim)
Creates a new instance of MyStringTokenizer. |
|
MyStringTokenizer(String _s,
String _delim,
boolean _returnTokens)
Creates a new instance of MyStringTokenizer. |
|
| Method Summary | |
boolean |
hasMoreDelimiters()
Are there any more delimiters in the string? This should only be called if hasMoreTokens is false, to determine if the string contains trailing delimiters. |
boolean |
hasMoreElements()
Are there any more tokens in the string |
boolean |
hasMoreTokens()
Are there any more tokens in the string |
static void |
main(String[] args)
|
Object |
nextElement()
Returns the next token |
String |
nextToken()
Returns the next token |
void |
putBackToken(String s)
Specifies a string to be added to the MyStringTokenizer object. |
String |
remainingTokens()
Returns a concatenation of all remaining tokens |
void |
setNoEscapeCharacter()
Turns off the escape character. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public MyStringTokenizer(String _s,
String _delim,
boolean _returnTokens)
s - The string to be tokenizeddelim - A string containing all delimitersreturnTokens - If true, return delimiters as tokens. This
differs from StringTokenizer in that adjacent delimiters are returned
in the same token.
public MyStringTokenizer(String _s,
String _delim)
s - The string to be tokenizeddelim - A string containing all delimiterspublic MyStringTokenizer(String _s)
s - The string to be tokenized| Method Detail |
public void setNoEscapeCharacter()
public boolean hasMoreTokens()
public boolean hasMoreElements()
public boolean hasMoreDelimiters()
public String nextToken()
public Object nextElement()
public void putBackToken(String s)
public String remainingTokens()
public static void main(String[] args)
throws IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||