Package com.yahoo.prelude.query.parser
Class Token
- java.lang.Object
-
- com.yahoo.prelude.query.parser.Token
-
public class Token extends Object
A query token.- Author:
- bratseth
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Token.Kind
-
Constructor Summary
Constructors Constructor Description Token(Token.Kind kind, String image)
Crates a token which fails to know its origin (as a substring).Token(Token.Kind kind, String image, boolean special, Substring substring)
Token(Token.Kind kind, String image, Substring substring)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object object)
Substring
getSubstring()
Returns the substring containing the image ins original form (including casing), as well as all the text surrounding the tokenint
hashCode()
boolean
isSpecial()
Returns whether this is a special tokenString
toString()
-
-
-
Field Detail
-
substring
public final Substring substring
The raw substring causing this token, never null
-
kind
public final Token.Kind kind
-
image
public final String image
Lowercase image
-
-
Constructor Detail
-
Token
public Token(Token.Kind kind, String image)
Crates a token which fails to know its origin (as a substring). Do not use, except for testing.
-
Token
public Token(Token.Kind kind, String image, Substring substring)
-
Token
public Token(Token.Kind kind, String image, boolean special, Substring substring)
-
-
Method Detail
-
isSpecial
public boolean isSpecial()
Returns whether this is a special token
-
getSubstring
public Substring getSubstring()
Returns the substring containing the image ins original form (including casing), as well as all the text surrounding the token- Returns:
- the image in original casing, never null
-
-