Enum Lexer.Token.Type
- java.lang.Object
-
- java.lang.Enum<Lexer.Token.Type>
-
- com.github.zafarkhaja.semver.expr.Lexer.Token.Type
-
- All Implemented Interfaces:
Stream.ElementType<Lexer.Token>,java.io.Serializable,java.lang.Comparable<Lexer.Token.Type>
- Enclosing class:
- Lexer.Token
static enum Lexer.Token.Type extends java.lang.Enum<Lexer.Token.Type> implements Stream.ElementType<Lexer.Token>
Valid token types.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ANDCARETDOTEOIEQUALGREATERGREATER_EQUALHYPHENLEFT_PARENLESSLESS_EQUALNOTNOT_EQUALNUMERICORRIGHT_PARENTILDEWHITESPACEWILDCARD
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.regex.PatternpatternA pattern matching this type.
-
Constructor Summary
Constructors Modifier Constructor Description privateType(java.lang.String regexp)Constructs a token type with a regular expression for the pattern.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisMatchedBy(Lexer.Token token)Checks if the specified element matches this type.java.lang.StringtoString()Returns the string representation of this type.static Lexer.Token.TypevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static Lexer.Token.Type[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NUMERIC
public static final Lexer.Token.Type NUMERIC
-
DOT
public static final Lexer.Token.Type DOT
-
HYPHEN
public static final Lexer.Token.Type HYPHEN
-
EQUAL
public static final Lexer.Token.Type EQUAL
-
NOT_EQUAL
public static final Lexer.Token.Type NOT_EQUAL
-
GREATER
public static final Lexer.Token.Type GREATER
-
GREATER_EQUAL
public static final Lexer.Token.Type GREATER_EQUAL
-
LESS
public static final Lexer.Token.Type LESS
-
LESS_EQUAL
public static final Lexer.Token.Type LESS_EQUAL
-
TILDE
public static final Lexer.Token.Type TILDE
-
WILDCARD
public static final Lexer.Token.Type WILDCARD
-
CARET
public static final Lexer.Token.Type CARET
-
AND
public static final Lexer.Token.Type AND
-
OR
public static final Lexer.Token.Type OR
-
NOT
public static final Lexer.Token.Type NOT
-
LEFT_PAREN
public static final Lexer.Token.Type LEFT_PAREN
-
RIGHT_PAREN
public static final Lexer.Token.Type RIGHT_PAREN
-
WHITESPACE
public static final Lexer.Token.Type WHITESPACE
-
EOI
public static final Lexer.Token.Type EOI
-
-
Constructor Detail
-
Type
private Type(java.lang.String regexp)
Constructs a token type with a regular expression for the pattern.- Parameters:
regexp- the regular expression for the pattern- See Also:
pattern
-
-
Method Detail
-
values
public static Lexer.Token.Type[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Lexer.Token.Type c : Lexer.Token.Type.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Lexer.Token.Type valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
toString
public java.lang.String toString()
Returns the string representation of this type.- Overrides:
toStringin classjava.lang.Enum<Lexer.Token.Type>- Returns:
- the string representation of this type
-
isMatchedBy
public boolean isMatchedBy(Lexer.Token token)
Checks if the specified element matches this type.- Specified by:
isMatchedByin interfaceStream.ElementType<Lexer.Token>- Parameters:
token- the element to be tested- Returns:
trueif the element matches this type orfalseotherwise
-
-