Class AbstractStringMatcher.TrimMatcher

java.lang.Object
org.apache.commons.text.matcher.AbstractStringMatcher
org.apache.commons.text.matcher.AbstractStringMatcher.TrimMatcher
All Implemented Interfaces:
StringMatcher
Enclosing class:
AbstractStringMatcher

static final class AbstractStringMatcher.TrimMatcher extends AbstractStringMatcher
Matches whitespace as per trim().

Thread=safe.

  • Field Details

  • Constructor Details

    • TrimMatcher

      TrimMatcher()
      Constructs a new instance of TrimMatcher.
  • Method Details

    • isMatch

      public int isMatch(char[] buffer, int start, int bufferStart, int bufferEnd)
      Returns 1 if there is a match, or 0 if there is no match.
      Parameters:
      buffer - the text content to match against, do not change
      start - the starting position for the match, valid for buffer
      bufferStart - unused
      bufferEnd - unused
      Returns:
      The number of matching characters, zero for no match
    • isMatch

      public int isMatch(CharSequence buffer, int start, int bufferStart, int bufferEnd)
      Returns 1 if there is a match, or 0 if there is no match.
      Parameters:
      buffer - the text content to match against, do not change
      start - the starting position for the match, valid for buffer
      bufferStart - unused
      bufferEnd - unused
      Returns:
      The number of matching characters, zero for no match
    • size

      public int size()
      Returns 1.
      Returns:
      the size of the matching string.
      Since:
      1.9