Class CharMatcher

java.lang.Object
com.oracle.truffle.regex.tregex.matchers.CharMatcher
Direct Known Subclasses:
AnyMatcher, EmptyMatcher, InvertibleCharMatcher

public abstract class CharMatcher extends Object
  • Constructor Details

    • CharMatcher

      public CharMatcher()
  • Method Details

    • match

      public abstract boolean match(int c)
      Check if a given code point matches this CharMatcher.
      Parameters:
      c - any code point.
      Returns:
      true if the character matches.
      See Also:
      • CompilerDirectives.isPartialEvaluationConstant(Object)
    • estimatedCost

      public abstract int estimatedCost()
      Conservatively estimate the equivalent number of integer comparisons of calling match(int).
      Returns:
      the number of integer comparisons one call to match(int) is roughly equivalent to. Array loads are treated as two comparisons.