Package org.apache.commons.text.matcher
Class AbstractStringMatcher.CharArrayMatcher
- java.lang.Object
-
- org.apache.commons.text.matcher.AbstractStringMatcher
-
- org.apache.commons.text.matcher.AbstractStringMatcher.CharArrayMatcher
-
- All Implemented Interfaces:
StringMatcher
- Enclosing class:
- AbstractStringMatcher
static final class AbstractStringMatcher.CharArrayMatcher extends AbstractStringMatcher
Matches out of a set of characters.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
-
-
Constructor Summary
Constructors Constructor Description CharArrayMatcher(char... chars)
Constructs a matcher from a String.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
isMatch(char[] buffer, int start, int bufferStart, int bufferEnd)
Returns the number of matching characters,0
if there is no match.int
isMatch(java.lang.CharSequence buffer, int start, int bufferStart, int bufferEnd)
Returns the number of matching characters,0
if there is no match.int
size()
Returns the size of the string to match given in the constructor.java.lang.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.commons.text.matcher.StringMatcher
andThen, isMatch, isMatch
-
-
-
-
Method Detail
-
isMatch
public int isMatch(char[] buffer, int start, int bufferStart, int bufferEnd)
Returns the number of matching characters,0
if 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
- the end index of the active buffer, valid for buffer- Returns:
- The number of matching characters, zero for no match
-
isMatch
public int isMatch(java.lang.CharSequence buffer, int start, int bufferStart, int bufferEnd)
Returns the number of matching characters,0
if 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
- the end index of the active buffer, valid for buffer- Returns:
- The number of matching characters, zero for no match
-
size
public int size()
Returns the size of the string to match given in the constructor.- Returns:
- the size of the matching string.
- Since:
- 1.9
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-