Class StrMatcher.TrimMatcher

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

private static final class StrMatcher.TrimMatcher extends StrMatcher
Class used to match whitespace as per trim().
Since:
1.0
  • Constructor Details

    • TrimMatcher

      private TrimMatcher()
      Constructs a new instance of TrimMatcher.
  • 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, or zero if there is no match.