Top Description Inners Fields Constructors Methods
org.apache.commons.lang3.text

public abstract Class StrMatcher

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.commons.lang3.text.StrMatcher.CharMatcher, org.apache.commons.lang3.text.StrMatcher.CharSetMatcher, org.apache.commons.lang3.text.StrMatcher.NoMatcher, org.apache.commons.lang3.text.StrMatcher.StringMatcher, org.apache.commons.lang3.text.StrMatcher.TrimMatcher
Annotations
@Deprecated
Imports
java.util.Arrays, org.apache.commons.lang3.ArraySorter, .ArrayUtils, .StringUtils

Deprecated

As of 3.6, use Apache Commons Text StringMatcherFactory.

A matcher class that can be queried to determine if a character array portion matches.

This class comes complete with various factory methods. If these do not suffice, you can subclass and implement your own matcher.

Since
2.2

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
StrMatcher.CharMatcher

References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Class used to define a character for matching purposes.
pack-priv static class
StrMatcher.CharSetMatcher

References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Class used to define a set of characters for matching purposes.
pack-priv static class
StrMatcher.NoMatcher

References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Class used to match no characters.
pack-priv static class
StrMatcher.StringMatcher

References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Class used to define a set of characters for matching purposes.
pack-priv static class
StrMatcher.TrimMatcher

References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Class used to match whitespace as per trim().

Field Summary

Modifier and TypeField and Description
private static final StrMatcher
COMMA_MATCHER

References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Matches the comma character.
private static final StrMatcher
DOUBLE_QUOTE_MATCHER

References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Matches the double quote character.
private static final StrMatcher
NONE_MATCHER

References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Matches no characters.
private static final StrMatcher
QUOTE_MATCHER

References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Matches the single or double quote character.
private static final StrMatcher
SINGLE_QUOTE_MATCHER

References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Matches the double quote character.
private static final StrMatcher
SPACE_MATCHER

References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Matches the space character.
private static final StrMatcher
SPLIT_MATCHER

References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Matches the same characters as StringTokenizer, namely space, tab, newline, formfeed.
private static final StrMatcher
TAB_MATCHER

References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Matches the tab character.
private static final StrMatcher
TRIM_MATCHER

References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Matches the String trim() whitespace characters.

Constructor Summary

AccessConstructor and Description
protected
StrMatcher()

Constructs a new instance.

Method Summary

Modifier and TypeMethod and Description
public static StrMatcher

Returns:

a new Matcher for the given char.
charMatcher
(final char
the character to match, must not be null.
ch
)
References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

Creates a matcher from a character.

public static StrMatcher

Returns:

a new matcher for the given char[].
charSetMatcher
(final char...
the characters to match, null or empty matches nothing.
chars
)
References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

Creates a matcher from a set of characters.

public static StrMatcher

Returns:

a new Matcher for the given characters.
charSetMatcher
(final String
the characters to match, null or empty matches nothing.
chars
)
References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

Creates a matcher from a string representing a set of characters.

public static StrMatcher

Returns:

the matcher for a comma.
commaMatcher
()
References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

Gets the matcher for the comma character.

public static StrMatcher

Returns:

the matcher for a double quote.
doubleQuoteMatcher
()
References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

Gets the matcher for the double quote character.

public int

Returns:

the number of matching characters, zero for no match.
isMatch
(final char[]
the text content to match against, do not change.
buffer
,
final int
the starting position for the match, valid for buffer.
pos
)

Tests whether the number of matching characters, zero for no match.

public abstract int

Returns:

the number of matching characters, zero for no match.
isMatch
(char[]
the text content to match against, do not change.
buffer
,
int
the starting position for the match, valid for buffer.
pos
,
int
the first active index in the buffer, valid for buffer.
bufferStart
,
int
the end index (exclusive) of the active buffer, valid for buffer.
bufferEnd
)

Tests whether the number of matching characters, zero for no match.

public static StrMatcher

Returns:

the matcher that matches nothing.
noneMatcher
()
References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

Gets the matcher for no characters.

public static StrMatcher

Returns:

the matcher for a single or double quote.
quoteMatcher
()
References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

Gets the matcher for the single or double quote character.

public static StrMatcher

Returns:

the matcher for a single quote.
singleQuoteMatcher
()
References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

Gets the matcher for the single quote character.

public static StrMatcher

Returns:

the matcher for a space.
spaceMatcher
()
References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

Gets the matcher for the space character.

public static StrMatcher

Returns:

the split matcher.
splitMatcher
()
References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

Gets the matcher for the same characters as StringTokenizer, namely space, tab, newline and form-feed.

public static StrMatcher

Returns:

a new Matcher for the given String.
stringMatcher
(final String
the string to match, null or empty matches nothing.
str
)
References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

Creates a matcher for a string.

public static StrMatcher

Returns:

the matcher for a tab.
tabMatcher
()
References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

Gets the matcher for the tab character.

public static StrMatcher

Returns:

the trim matcher.
trimMatcher
()
References Deprecated StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

Gets the matcher to String trim() whitespace characters.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

COMMA_MATCHERback to summary
private static final StrMatcher COMMA_MATCHER

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Matches the comma character.

DOUBLE_QUOTE_MATCHERback to summary
private static final StrMatcher DOUBLE_QUOTE_MATCHER

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Matches the double quote character.

NONE_MATCHERback to summary
private static final StrMatcher NONE_MATCHER

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Matches no characters.

QUOTE_MATCHERback to summary
private static final StrMatcher QUOTE_MATCHER

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Matches the single or double quote character.

SINGLE_QUOTE_MATCHERback to summary
private static final StrMatcher SINGLE_QUOTE_MATCHER

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Matches the double quote character.

SPACE_MATCHERback to summary
private static final StrMatcher SPACE_MATCHER

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Matches the space character.

SPLIT_MATCHERback to summary
private static final StrMatcher SPLIT_MATCHER

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Matches the same characters as StringTokenizer, namely space, tab, newline, formfeed.

TAB_MATCHERback to summary
private static final StrMatcher TAB_MATCHER

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Matches the tab character.

TRIM_MATCHERback to summary
private static final StrMatcher TRIM_MATCHER

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Matches the String trim() whitespace characters.

Constructor Detail

StrMatcherback to summary
protected StrMatcher()

Constructs a new instance.

Method Detail

charMatcherback to summary
public static StrMatcher charMatcher(final char ch)

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Creates a matcher from a character.

Parameters
ch:char

the character to match, must not be null.

Returns:StrMatcher

a new Matcher for the given char.

charSetMatcherback to summary
public static StrMatcher charSetMatcher(final char... chars)

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Creates a matcher from a set of characters.

Parameters
chars:char[]

the characters to match, null or empty matches nothing.

Returns:StrMatcher

a new matcher for the given char[].

charSetMatcherback to summary
public static StrMatcher charSetMatcher(final String chars)

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Creates a matcher from a string representing a set of characters.

Parameters
chars:String

the characters to match, null or empty matches nothing.

Returns:StrMatcher

a new Matcher for the given characters.

commaMatcherback to summary
public static StrMatcher commaMatcher()

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Gets the matcher for the comma character.

Returns:StrMatcher

the matcher for a comma.

doubleQuoteMatcherback to summary
public static StrMatcher doubleQuoteMatcher()

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Gets the matcher for the double quote character.

Returns:StrMatcher

the matcher for a double quote.

isMatchback to summary
public int isMatch(final char[] buffer, final int pos)

Tests whether the number of matching characters, zero for no match.

This method is called to check for a match. The parameter pos represents the current position to be checked in the string buffer (a character array which must not be changed). The API guarantees that pos is a valid index for buffer.

The matching code may check one character or many. It may check characters preceding pos as well as those after.

It must return zero for no match, or a positive number if a match was found. The number indicates the number of characters that matched.

Parameters
buffer:char[]

the text content to match against, do not change.

pos:int

the starting position for the match, valid for buffer.

Returns:int

the number of matching characters, zero for no match.

Since
2.4
isMatchback to summary
public abstract int isMatch(char[] buffer, int pos, int bufferStart, int bufferEnd)

Tests whether the number of matching characters, zero for no match.

This method is called to check for a match. The parameter pos represents the current position to be checked in the string buffer (a character array which must not be changed). The API guarantees that pos is a valid index for buffer.

The character array may be larger than the active area to be matched. Only values in the buffer between the specified indices may be accessed.

The matching code may check one character or many. It may check characters preceding pos as well as those after, so long as no checks exceed the bounds specified.

It must return zero for no match, or a positive number if a match was found. The number indicates the number of characters that matched.

Parameters
buffer:char[]

the text content to match against, do not change.

pos:int

the starting position for the match, valid for buffer.

bufferStart:int

the first active index in the buffer, valid for buffer.

bufferEnd:int

the end index (exclusive) of the active buffer, valid for buffer.

Returns:int

the number of matching characters, zero for no match.

noneMatcherback to summary
public static StrMatcher noneMatcher()

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Gets the matcher for no characters.

Returns:StrMatcher

the matcher that matches nothing.

quoteMatcherback to summary
public static StrMatcher quoteMatcher()

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Gets the matcher for the single or double quote character.

Returns:StrMatcher

the matcher for a single or double quote.

singleQuoteMatcherback to summary
public static StrMatcher singleQuoteMatcher()

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Gets the matcher for the single quote character.

Returns:StrMatcher

the matcher for a single quote.

spaceMatcherback to summary
public static StrMatcher spaceMatcher()

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Gets the matcher for the space character.

Returns:StrMatcher

the matcher for a space.

splitMatcherback to summary
public static StrMatcher splitMatcher()

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Gets the matcher for the same characters as StringTokenizer, namely space, tab, newline and form-feed.

Returns:StrMatcher

the split matcher.

stringMatcherback to summary
public static StrMatcher stringMatcher(final String str)

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Creates a matcher for a string.

Parameters
str:String

the string to match, null or empty matches nothing.

Returns:StrMatcher

a new Matcher for the given String.

tabMatcherback to summary
public static StrMatcher tabMatcher()

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Gets the matcher for the tab character.

Returns:StrMatcher

the matcher for a tab.

trimMatcherback to summary
public static StrMatcher trimMatcher()

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Gets the matcher to String trim() whitespace characters.

Returns:StrMatcher

the trim matcher.

org.apache.commons.lang3.text back to summary

pack-priv final Class StrMatcher.CharMatcher

extends StrMatcher
Class Inheritance

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Class used to define a character for matching purposes.

Field Summary

Modifier and TypeField and Description
private final char
ch

The character to match.

Constructor Summary

AccessConstructor and Description
pack-priv
CharMatcher(final char
the character to match.
ch
)

Constructor that creates a matcher that matches a single character.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the number of matching characters, zero for no match.
isMatch
(final char[]
the text content to match against, do not change.
buffer
,
final int
the starting position for the match, valid for buffer.
pos
,
final int
the first active index in the buffer, valid for buffer.
bufferStart
,
final int
the end index of the active buffer, valid for buffer.
bufferEnd
)

Implements abstract org.apache.commons.lang3.text.StrMatcher.isMatch.

Tests whether or not the given character matches.

Inherited from org.apache.commons.lang3.text.StrMatcher:
charMatchercharSetMatchercharSetMatchercommaMatcherdoubleQuoteMatcherisMatchnoneMatcherquoteMatchersingleQuoteMatcherspaceMatchersplitMatcherstringMatchertabMatchertrimMatcher

Field Detail

chback to summary
private final char ch

The character to match.

Constructor Detail

CharMatcherback to summary
pack-priv CharMatcher(final char ch)

Constructor that creates a matcher that matches a single character.

Parameters
ch:char

the character to match.

Method Detail

isMatchback to summary
public int isMatch(final char[] buffer, final int pos, final int bufferStart, final int bufferEnd)

Implements abstract org.apache.commons.lang3.text.StrMatcher.isMatch.

Tests whether or not the given character matches.

Parameters
buffer:char[]

the text content to match against, do not change.

pos:int

the starting position for the match, valid for buffer.

bufferStart:int

the first active index in the buffer, valid for buffer.

bufferEnd:int

the end index of the active buffer, valid for buffer.

Returns:int

the number of matching characters, zero for no match.

Annotations
@Override
org.apache.commons.lang3.text back to summary

pack-priv final Class StrMatcher.CharSetMatcher

extends StrMatcher
Class Inheritance

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Class used to define a set of characters for matching purposes.

Field Summary

Modifier and TypeField and Description
private final char[]
chars

The set of characters to match.

Constructor Summary

AccessConstructor and Description
pack-priv
CharSetMatcher(final char[]
the characters to match, must not be null.
chars
)

Constructor that creates a matcher from a character array.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the number of matching characters, zero for no match.
isMatch
(final char[]
the text content to match against, do not change.
buffer
,
final int
the starting position for the match, valid for buffer.
pos
,
final int
the first active index in the buffer, valid for buffer.
bufferStart
,
final int
the end index of the active buffer, valid for buffer.
bufferEnd
)

Implements abstract org.apache.commons.lang3.text.StrMatcher.isMatch.

Returns whether or not the given character matches.

Inherited from org.apache.commons.lang3.text.StrMatcher:
charMatchercharSetMatchercharSetMatchercommaMatcherdoubleQuoteMatcherisMatchnoneMatcherquoteMatchersingleQuoteMatcherspaceMatchersplitMatcherstringMatchertabMatchertrimMatcher

Field Detail

charsback to summary
private final char[] chars

The set of characters to match.

Constructor Detail

CharSetMatcherback to summary
pack-priv CharSetMatcher(final char[] chars)

Constructor that creates a matcher from a character array.

Parameters
chars:char[]

the characters to match, must not be null.

Method Detail

isMatchback to summary
public int isMatch(final char[] buffer, final int pos, final int bufferStart, final int bufferEnd)

Implements abstract org.apache.commons.lang3.text.StrMatcher.isMatch.

Returns whether or not the given character matches.

Parameters
buffer:char[]

the text content to match against, do not change.

pos:int

the starting position for the match, valid for buffer.

bufferStart:int

the first active index in the buffer, valid for buffer.

bufferEnd:int

the end index of the active buffer, valid for buffer.

Returns:int

the number of matching characters, zero for no match.

Annotations
@Override
org.apache.commons.lang3.text back to summary

pack-priv final Class StrMatcher.NoMatcher

extends StrMatcher
Class Inheritance

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Class used to match no characters.

Constructor Summary

AccessConstructor and Description
pack-priv
NoMatcher()

Constructs a new instance of NoMatcher.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the number of matching characters, zero for no match.
isMatch
(final char[]
the text content to match against, do not change.
buffer
,
final int
the starting position for the match, valid for buffer.
pos
,
final int
the first active index in the buffer, valid for buffer.
bufferStart
,
final int
the end index of the active buffer, valid for buffer.
bufferEnd
)

Implements abstract org.apache.commons.lang3.text.StrMatcher.isMatch.

Always returns false.

Inherited from org.apache.commons.lang3.text.StrMatcher:
charMatchercharSetMatchercharSetMatchercommaMatcherdoubleQuoteMatcherisMatchnoneMatcherquoteMatchersingleQuoteMatcherspaceMatchersplitMatcherstringMatchertabMatchertrimMatcher

Constructor Detail

NoMatcherback to summary
pack-priv NoMatcher()

Constructs a new instance of NoMatcher.

Method Detail

isMatchback to summary
public int isMatch(final char[] buffer, final int pos, final int bufferStart, final int bufferEnd)

Implements abstract org.apache.commons.lang3.text.StrMatcher.isMatch.

Always returns false.

Parameters
buffer:char[]

the text content to match against, do not change.

pos:int

the starting position for the match, valid for buffer.

bufferStart:int

the first active index in the buffer, valid for buffer.

bufferEnd:int

the end index of the active buffer, valid for buffer.

Returns:int

the number of matching characters, zero for no match.

Annotations
@Override
org.apache.commons.lang3.text back to summary

pack-priv final Class StrMatcher.StringMatcher

extends StrMatcher
Class Inheritance

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Class used to define a set of characters for matching purposes.

Field Summary

Modifier and TypeField and Description
private final char[]
chars

The string to match, as a character array.

Constructor Summary

AccessConstructor and Description
pack-priv
StringMatcher(final String
the string to match, must not be null
str
)

Constructor that creates a matcher from a String.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the number of matching characters, zero for no match.
isMatch
(final char[]
the text content to match against, do not change.
buffer
,
int
the starting position for the match, valid for buffer.
pos
,
final int
the first active index in the buffer, valid for buffer.
bufferStart
,
final int
the end index of the active buffer, valid for buffer.
bufferEnd
)

Implements abstract org.apache.commons.lang3.text.StrMatcher.isMatch.

Tests whether or not the given text matches the stored string.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from org.apache.commons.lang3.text.StrMatcher:
charMatchercharSetMatchercharSetMatchercommaMatcherdoubleQuoteMatcherisMatchnoneMatcherquoteMatchersingleQuoteMatcherspaceMatchersplitMatcherstringMatchertabMatchertrimMatcher

Field Detail

charsback to summary
private final char[] chars

The string to match, as a character array.

Constructor Detail

StringMatcherback to summary
pack-priv StringMatcher(final String str)

Constructor that creates a matcher from a String.

Parameters
str:String

the string to match, must not be null

Method Detail

isMatchback to summary
public int isMatch(final char[] buffer, int pos, final int bufferStart, final int bufferEnd)

Implements abstract org.apache.commons.lang3.text.StrMatcher.isMatch.

Tests whether or not the given text matches the stored string.

Parameters
buffer:char[]

the text content to match against, do not change.

pos:int

the starting position for the match, valid for buffer.

bufferStart:int

the first active index in the buffer, valid for buffer.

bufferEnd:int

the end index of the active buffer, valid for buffer.

Returns:int

the number of matching characters, zero for no match.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
org.apache.commons.lang3.text back to summary

pack-priv final Class StrMatcher.TrimMatcher

extends StrMatcher
Class Inheritance

References Deprecated

StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Class used to match whitespace as per trim().

Constructor Summary

AccessConstructor and Description
pack-priv
TrimMatcher()

Constructs a new instance of TrimMatcher.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the number of matching characters, zero for no match.
isMatch
(final char[]
the text content to match against, do not change.
buffer
,
final int
the starting position for the match, valid for buffer.
pos
,
final int
the first active index in the buffer, valid for buffer.
bufferStart
,
final int
the end index of the active buffer, valid for buffer.
bufferEnd
)

Implements abstract org.apache.commons.lang3.text.StrMatcher.isMatch.

Tests whether or not the given character matches.

Inherited from org.apache.commons.lang3.text.StrMatcher:
charMatchercharSetMatchercharSetMatchercommaMatcherdoubleQuoteMatcherisMatchnoneMatcherquoteMatchersingleQuoteMatcherspaceMatchersplitMatcherstringMatchertabMatchertrimMatcher

Constructor Detail

TrimMatcherback to summary
pack-priv TrimMatcher()

Constructs a new instance of TrimMatcher.

Method Detail

isMatchback to summary
public int isMatch(final char[] buffer, final int pos, final int bufferStart, final int bufferEnd)

Implements abstract org.apache.commons.lang3.text.StrMatcher.isMatch.

Tests whether or not the given character matches.

Parameters
buffer:char[]

the text content to match against, do not change.

pos:int

the starting position for the match, valid for buffer.

bufferStart:int

the first active index in the buffer, valid for buffer.

bufferEnd:int

the end index of the active buffer, valid for buffer.

Returns:int

the number of matching characters, zero for no match.

Annotations
@Override