|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@Immutable public static interface TokenStream.Token

The interface defining a token, which references the characters in the actual input character stream.
TokenStream.CaseSensitiveTokenFactory,
TokenStream.CaseInsensitiveTokenFactory| Method Summary | |
|---|---|
int |
endIndex()
Get the index in the raw stream past the last character in the token. |
int |
length()
Get the length of the token, which is equivalent to endIndex() - startIndex(). |
boolean |
matches(char expected)
Determine if the token matches the supplied character. |
boolean |
matches(int expectedType)
Determine if the token matches the supplied type. |
boolean |
matches(String expected)
Determine if the token matches the supplied string. |
Position |
position()
Get the position of this token, which includes the line number and column number of the first character in the token. |
int |
startIndex()
Get the index in the raw stream for the first character in the token. |
int |
type()
Get the type of the token. |
String |
value()
Get the value of the token, in actual case. |
TokenStream.Token |
withType(int typeMask)
Bitmask ORed with existing type value. |
| Method Detail |
|---|
String value()
boolean matches(String expected)
expected - the expected value
boolean matches(char expected)
expected - the expected character value
boolean matches(int expectedType)
expectedType - the expected integer type
int type()
int startIndex()
int endIndex()
int length()
endIndex() - startIndex().
Position position()
TokenStream.Token withType(int typeMask)
typeMask -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||