Class StrMatcher.CharMatcher

java.lang.Object
org.apache.commons.lang3.text.StrMatcher
org.apache.commons.lang3.text.StrMatcher.CharMatcher
Enclosing class:
StrMatcher

static final class StrMatcher.CharMatcher extends StrMatcher
Class used to define a character for matching purposes.
  • Field Details

    • ch

      private final char ch
      The character to match.
  • Constructor Details

    • CharMatcher

      CharMatcher(char ch)
      Constructor that creates a matcher that matches a single character.
      Parameters:
      ch - the character to match
  • Method Details

    • isMatch

      public int isMatch(char[] buffer, int pos, int bufferStart, int bufferEnd)
      Returns whether or not the given character matches.
      Specified by:
      isMatch in class StrMatcher
      Parameters:
      buffer - the text content to match against, do not change
      pos - the starting position for the match, valid for buffer
      bufferStart - the first active index in the buffer, valid for buffer
      bufferEnd - the end index of the active buffer, valid for buffer
      Returns:
      the number of matching characters, zero for no match