|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.nukesoft.bot2.botutil.ExtendedStringTokenizer
The ExtendedStringTokenizer class us used much the same way as a StringTokenizer, but provides some enhanced functionality usefull to writing command parsers. These include token peeking, parsing quoted strings as single tokens, and returning the rest of the token stream as a single string.
Constructor Summary | |
ExtendedStringTokenizer(String str)
|
Method Summary | |
boolean |
containsToken(String token)
Determines if this tokenizer's input string contains a given token. |
boolean |
containsTokenIgnoreCase(String token)
Determines if this tokenizer's input string contains a given token. |
int |
countTokens()
Calculates the number of times that this tokenizer's nextToken method can be called before it generates an exception. |
boolean |
hasMoreTokens()
Tests if there are more tokens available from this tokenizer's string. |
String |
nextQuotedToken()
Returns the next quoted token from this string tokenizer. |
String |
nextToken()
Returns the next token from this string tokenizer. |
String |
peekNextToken()
Returns the next token from this string tokenizer without actually removing the token from the token stream. |
String |
restTokens()
Returns all remaining tokens in a single string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ExtendedStringTokenizer(String str)
Method Detail |
public int countTokens()
public boolean hasMoreTokens()
public String nextToken() throws NoSuchElementException
NoSuchElementException
- if there are no more
tokens in this tokenizer's string.public String nextQuotedToken() throws NoSuchElementException
NoSuchElementException
- if there are no more
tokens in this tokenizer's string.public String peekNextToken() throws NoSuchElementException
NoSuchElementException
- if there are no more
tokens in this tokenizer's string.public String restTokens()
public boolean containsToken(String token)
token
- The token to test.
public boolean containsTokenIgnoreCase(String token)
token
- The token to test.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |