java.lang.Object
net.luis.utils.io.token.definition.WordTokenDefinition
- All Implemented Interfaces:
TokenDefinition
,TokenRule
Token definition for a word.
This token definition matches a string that is not empty.
It should be used for tokens that cannot be defined by a single character or string.
An example would be identifiers in programming languages.
This token definition matches a string that is not empty.
It should be used for tokens that cannot be defined by a single character or string.
An example would be identifiers in programming languages.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final WordTokenDefinition
Singleton instance of the word token definition. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Private constructor to prevent instantiation. -
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.luis.utils.io.token.definition.TokenDefinition
match
Methods inherited from interface net.luis.utils.io.token.rule.rules.TokenRule
optional, repeatAtLeast, repeatAtMost, repeatBetween, repeatExactly, repeatInfinitely
-
Field Details
-
INSTANCE
Singleton instance of the word token definition.
-
-
Constructor Details
-
WordTokenDefinition
private WordTokenDefinition()Private constructor to prevent instantiation.
-
-
Method Details
-
matches
Description copied from interface:TokenDefinition
Checks if the given word matches this token definition.- Specified by:
matches
in interfaceTokenDefinition
- Parameters:
word
- The word to check- Returns:
- True if the word matches this token definition, false otherwise
-
equals
-
hashCode
public int hashCode() -
toString
-