|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.overlord.sramp.common.query.xpath.TokenStream
public class TokenStream
A stream of tokens produced by the tokenizer.
| Constructor Summary | |
|---|---|
TokenStream()
Constructor. |
|
| Method Summary | |
|---|---|
void |
addToken(String value,
TokenType type)
Adds a token to the stream. |
TokenStream |
build()
Builds the stream for consumption. |
boolean |
canConsume(String tokenValue)
Attempts to consume a token that matches any of the given token values. |
boolean |
canConsume(String tokenValue1,
String tokenValue2)
Attempts to consume the next two tokens, but only if they match the given token values. |
boolean |
canConsumeAnyOf(String... tokenValues)
Attempts to consume a token that matches any of the given token values. |
Token |
consume()
Consume the next token in the stream, and return what it was. |
boolean |
hasNext()
Returns true if there are more tokens in the stream. |
boolean |
matches(String tokenValue)
Returns true if the next token in the stream matches any of the given token values. |
boolean |
matches(TokenType tokenType)
Returns true if the next token in the stream matches any of the given types. |
boolean |
matchesAnyOf(String... tokenValues)
Returns true if the next token in the stream matches any of the given token values. |
boolean |
matchesAnyOf(TokenType... tokenTypes)
Returns true if the next token in the stream matches any of the given types. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TokenStream()
| Method Detail |
|---|
public void addToken(String value,
TokenType type)
value - type - public TokenStream build()
public boolean hasNext()
public boolean canConsume(String tokenValue)
tokenValue -
public boolean canConsume(String tokenValue1,
String tokenValue2)
tokenValue1 - tokenValue2 - public boolean canConsumeAnyOf(String... tokenValues)
tokenValues - public boolean matches(TokenType tokenType)
tokenType - public boolean matchesAnyOf(TokenType... tokenTypes)
tokenTypes - public boolean matches(String tokenValue)
tokenValue - public boolean matchesAnyOf(String... tokenValues)
tokenValues - public Token consume()
public String toString()
toString in class ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||