@Immutable public static interface TokenStream.Token
Modifier and Type | Method and Description |
---|---|
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.
|
String value()
boolean matches(String expected)
expected
- the expected valueboolean matches(char expected)
expected
- the expected character valueboolean matches(int expectedType)
expectedType
- the expected integer typeint type()
int startIndex()
int endIndex()
int length()
endIndex() - startIndex()
.Position position()
TokenStream.Token withType(int typeMask)
typeMask
- Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.