Class RangeListMatcher
java.lang.Object
com.oracle.truffle.regex.tregex.matchers.CharMatcher
com.oracle.truffle.regex.tregex.matchers.InvertibleCharMatcher
com.oracle.truffle.regex.tregex.matchers.RangeListMatcher
Character range matcher using a sorted list of ranges.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThis matcher should be used only if the number of ranges is less or equal to this threshold. -
Method Summary
Modifier and TypeMethodDescriptionstatic RangeListMatchercreate(boolean invert, int[] ranges) intConservatively estimate the equivalent number of integer comparisons of callingCharMatcher.match(int).booleanmatch(int c) Check if a given code point matches thisCharMatcher.toString()Methods inherited from class com.oracle.truffle.regex.tregex.matchers.InvertibleCharMatcher
modifiersToString, result, result
-
Field Details
-
MAX_NUMBER_OF_RANGES
public static final int MAX_NUMBER_OF_RANGESThis matcher should be used only if the number of ranges is less or equal to this threshold.- See Also:
-
-
Method Details
-
create
-
match
public boolean match(int c) Description copied from class:CharMatcherCheck if a given code point matches thisCharMatcher.- Specified by:
matchin classCharMatcher- Parameters:
c- any code point.- Returns:
trueif the character matches.- See Also:
-
estimatedCost
public int estimatedCost()Description copied from class:CharMatcherConservatively estimate the equivalent number of integer comparisons of callingCharMatcher.match(int).- Specified by:
estimatedCostin classCharMatcher- Returns:
- the number of integer comparisons one call to
CharMatcher.match(int)is roughly equivalent to. Array loads are treated as two comparisons.
-
toString
-