Enum Class Lexer.Token.Type
- All Implemented Interfaces:
Stream.ElementType<Lexer.Token>
,Serializable
,Comparable<Lexer.Token.Type>
,Constable
- Enclosing class:
- Lexer.Token
static enum Lexer.Token.Type
extends Enum<Lexer.Token.Type>
implements Stream.ElementType<Lexer.Token>
Valid token types.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
isMatchedBy
(Lexer.Token token) Checks if the specified element matches this type.toString()
Returns the string representation of this type.static Lexer.Token.Type
Returns the enum constant of this class with the specified name.static Lexer.Token.Type[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NUMERIC
-
DOT
-
HYPHEN
-
EQUAL
-
NOT_EQUAL
-
GREATER
-
GREATER_EQUAL
-
LESS
-
LESS_EQUAL
-
TILDE
-
WILDCARD
-
CARET
-
AND
-
OR
-
NOT
-
LEFT_PAREN
-
RIGHT_PAREN
-
WHITESPACE
-
EOI
-
-
Field Details
-
pattern
A pattern matching this type.
-
-
Constructor Details
-
Type
Constructs a token type with a regular expression for the pattern.- Parameters:
regexp
- the regular expression for the pattern- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
toString
Returns the string representation of this type.- Overrides:
toString
in classEnum<Lexer.Token.Type>
- Returns:
- the string representation of this type
-
isMatchedBy
Checks if the specified element matches this type.- Specified by:
isMatchedBy
in interfaceStream.ElementType<Lexer.Token>
- Parameters:
token
- the element to be tested- Returns:
true
if the element matches this type orfalse
otherwise
-