Class ChoiceGroup
java.lang.Object
io.github.syst3ms.skriptparser.pattern.ChoiceGroup
- All Implemented Interfaces:
PatternElement
A group of multiple choices, represented by ChoiceElements
-
Constructor Summary
ConstructorsConstructorDescriptionChoiceGroup(ChoiceElement... choices) Only used in unit testsChoiceGroup(List<ChoiceElement> choices) -
Method Summary
Modifier and TypeMethodDescriptionbooleanintmatch(String s, int index, MatchContext context) Attempts to match thePatternElementto a string at a specified index.toString()
-
Constructor Details
-
ChoiceGroup
-
ChoiceGroup
Only used in unit tests
-
-
Method Details
-
getChoices
-
equals
-
match
Description copied from interface:PatternElementAttempts to match thePatternElementto a string at a specified index. About the index, make sure to never increment the index by some arbitrary value when returning- Specified by:
matchin interfacePatternElement- Parameters:
s- the string to match this PatternElement againstindex- the index of the string at which this PatternElement should be matched- Returns:
- the index at which the matching should continue afterwards if successful. Otherwise, -1
-
toString
-