Package org.apache.commons.lang3.text
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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.commons.lang3.text.StrMatcher
StrMatcher.CharMatcher, StrMatcher.CharSetMatcher, StrMatcher.NoMatcher, StrMatcher.StringMatcher, StrMatcher.TrimMatcher
-
-
Field Summary
Fields Modifier and Type Field Description private char
ch
The character to match.
-
Constructor Summary
Constructors Constructor Description CharMatcher(char ch)
Constructor that creates a matcher that matches a single character.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
isMatch(char[] buffer, int pos, int bufferStart, int bufferEnd)
Returns whether or not the given character matches.-
Methods inherited from class org.apache.commons.lang3.text.StrMatcher
charMatcher, charSetMatcher, charSetMatcher, commaMatcher, doubleQuoteMatcher, isMatch, noneMatcher, quoteMatcher, singleQuoteMatcher, spaceMatcher, splitMatcher, stringMatcher, tabMatcher, trimMatcher
-
-
-
-
Method Detail
-
isMatch
public int isMatch(char[] buffer, int pos, int bufferStart, int bufferEnd)
Returns whether or not the given character matches.- Specified by:
isMatch
in classStrMatcher
- Parameters:
buffer
- the text content to match against, do not changepos
- the starting position for the match, valid for bufferbufferStart
- the first active index in the buffer, valid for bufferbufferEnd
- the end index of the active buffer, valid for buffer- Returns:
- the number of matching characters, zero for no match
-
-