public interface Token
| Modifier and Type | Method and Description |
|---|---|
Boolean |
asBoolean()
Get the boolean typed value.
|
Float |
asFloat()
Get the float typed value.
|
Integer |
asInteger()
Get the integer typed value.
|
String |
asString()
Get the string typed value.
|
Position |
getPosition()
Start position of the token.
|
String |
getRaw()
The raw string recognized by the scanner.
|
TokenType |
getType()
Get the token type class.
|
Position getPosition()
nullString getRaw()
For example a string token "foo" has the raw value "foo" in contrast
it's typed string value will be foo.
nullTokenType getType()
nullBoolean asBoolean()
This method throws UnsupportedOperationException if the token's token class
is not of type TokenType.BOOLEAN.
nullFloat asFloat()
This method throws UnsupportedOperationException if the token's token class
is not of type TokenType.FLOAT.
nullInteger asInteger()
This method throws UnsupportedOperationException if the token's token class
is not of type TokenType.INTEGER.
nullString asString()
This method never throws UnsupportedOperationException.
It always calls Object.toString() on the recognized typed value.
nullCopyright © 2014 Sven Strittmatter. All Rights Reserved.