Package com.tonic.analysis.query.parser
Class Token
- java.lang.Object
-
- com.tonic.analysis.query.parser.Token
-
public final class Token extends Object
Token produced by QueryLexer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classToken.TokenTypeThe lexical kinds of the query language.
-
Constructor Summary
Constructors Constructor Description Token(Token.TokenType type, String value, int position)Creates a token.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)inthashCode()intposition()StringtoString()Token.TokenTypetype()Stringvalue()
-
-
-
Constructor Detail
-
Token
public Token(Token.TokenType type, String value, int position)
Creates a token.- Parameters:
type- the token kindvalue- the matched text, or null if the kind carries noneposition- the character offset where the token starts
-
-
Method Detail
-
type
public Token.TokenType type()
- Returns:
- the token kind
-
value
public String value()
- Returns:
- the matched text, or null for tokens that carry none
-
position
public int position()
- Returns:
- the character offset where the token starts
-
-