java.lang.Object
net.luis.utils.io.token.rule.rules.EndTokenRule
- All Implemented Interfaces:
TokenRule
A token rule that always matches the end of the token list.
This rule is useful to ensure that the end of the token list is reached.
The rule will only match if the start index is larger than or equal to the size of the token list.
This class is implemented as a singleton and can be accessed via
This rule is useful to ensure that the end of the token list is reached.
The rule will only match if the start index is larger than or equal to the size of the token list.
This class is implemented as a singleton and can be accessed via
TokenRules.end()
or INSTANCE
.-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Private constructor to prevent instantiation. -
Method Summary
Modifier and TypeMethodDescription@Nullable TokenRuleMatch
Checks if the given tokens match this rule starting from the specified index.
If the match is successful, aTokenRuleMatch
is returned, otherwise null.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.luis.utils.io.token.rule.rules.TokenRule
optional, repeatAtLeast, repeatAtMost, repeatBetween, repeatExactly, repeatInfinitely
-
Field Details
-
INSTANCE
The singleton instance of this class.
-
-
Constructor Details
-
EndTokenRule
private EndTokenRule()Private constructor to prevent instantiation.
-
-
Method Details
-
match
@Nullable public @Nullable TokenRuleMatch match(@NotNull @NotNull List<Token> tokens, int startIndex) Description copied from interface:TokenRule
Checks if the given tokens match this rule starting from the specified index.
If the match is successful, aTokenRuleMatch
is returned, otherwise null.
-