T - type of the recognized valueabstract class BaseToken<T> extends Object implements Token
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
BaseToken.BooleanToken
Concrete implementation of boolean token.
|
(package private) static class |
BaseToken.FloatToken
Concrete implementation of boolean token.
|
(package private) static class |
BaseToken.IntegerToken
Concrete implementation of boolean token.
|
(package private) static class |
BaseToken.KeywordToken
Concrete implementation of boolean token.
|
(package private) static class |
BaseToken.LiteralToken
Concrete implementation of boolean token.
|
(package private) static class |
BaseToken.StringToken
Concrete implementation of boolean token.
|
| Modifier and Type | Field and Description |
|---|---|
private Position |
position
Start position of token.
|
private String |
raw
Raw scanned lexeme.
|
private TokenType |
type
Token class type.
|
private T |
value
Recognized typed token value.
|
| Constructor and Description |
|---|
BaseToken(TokenType type,
Position position,
String raw,
T value)
Dedicated constructor .
|
| Modifier and Type | Method and Description |
|---|---|
String |
asString()
Get the string typed value.
|
boolean |
equals(Object obj) |
Position |
getPosition()
Start position of the token.
|
String |
getRaw()
The raw string recognized by the scanner.
|
TokenType |
getType()
Get the token type class.
|
(package private) T |
getValue()
Get the typed value.
|
int |
hashCode() |
String |
toString() |
private final TokenType type
private final Position position
private final String raw
private final T value
public final TokenType getType()
public final Position getPosition()
getPosition in interface Tokennullpublic final String getRaw()
For example a string token "foo" has the raw value "foo" in contrast
it's typed string value will be foo.
final T getValue()
nullCopyright © 2014 Sven Strittmatter. All Rights Reserved.