Package org.apache.commons.text.matcher
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
Matches whitespace as per trim().
Thread=safe.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.commons.text.matcher.AbstractStringMatcher
AbstractStringMatcher.AndStringMatcher, AbstractStringMatcher.CharArrayMatcher, AbstractStringMatcher.CharMatcher, AbstractStringMatcher.CharSetMatcher, AbstractStringMatcher.NoneMatcher, AbstractStringMatcher.TrimMatcher -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintisMatch(char[] buffer, int start, int bufferStart, int bufferEnd) Returns1if there is a match, or0if there is no match.intisMatch(CharSequence buffer, int start, int bufferStart, int bufferEnd) Returns1if there is a match, or0if there is no match.intsize()Returns 1.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.text.matcher.StringMatcher
andThen, isMatch, isMatch
-
Field Details
-
SPACE_INT
private static final int SPACE_INTThe space character.- See Also:
-
-
Constructor Details
-
TrimMatcher
TrimMatcher()Constructs a new instance ofTrimMatcher.
-
-
Method Details
-
isMatch
public int isMatch(char[] buffer, int start, int bufferStart, int bufferEnd) Returns1if there is a match, or0if there is no match.- Parameters:
buffer- the text content to match against, do not changestart- the starting position for the match, valid for bufferbufferStart- unusedbufferEnd- unused- Returns:
- The number of matching characters, zero for no match
-
isMatch
Returns1if there is a match, or0if there is no match.- Parameters:
buffer- the text content to match against, do not changestart- the starting position for the match, valid for bufferbufferStart- unusedbufferEnd- 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
-