Class StrMatcher
This class comes complete with various factory methods. If these do not suffice, you can subclass and implement your own matcher.
- Since:
- 2.2
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic StrMatchercharMatcher(char ch) Deprecated.Constructor that creates a matcher from a character.static StrMatchercharSetMatcher(char... chars) Deprecated.Constructor that creates a matcher from a set of characters.static StrMatchercharSetMatcher(String chars) Deprecated.Constructor that creates a matcher from a string representing a set of characters.static StrMatcherDeprecated.Returns a matcher which matches the comma character.static StrMatcherDeprecated.Returns a matcher which matches the double quote character.intisMatch(char[] buffer, int pos) Deprecated.Returns the number of matching characters, zero for no match.abstract intisMatch(char[] buffer, int pos, int bufferStart, int bufferEnd) Deprecated.Returns the number of matching characters, zero for no match.static StrMatcherDeprecated.Matches no characters.static StrMatcherDeprecated.Returns a matcher which matches the single or double quote character.static StrMatcherDeprecated.Returns a matcher which matches the single quote character.static StrMatcherDeprecated.Returns a matcher which matches the space character.static StrMatcherDeprecated.Matches the same characters as StringTokenizer, namely space, tab, newline and formfeed.static StrMatcherstringMatcher(String str) Deprecated.Constructor that creates a matcher from a string.static StrMatcherDeprecated.Returns a matcher which matches the tab character.static StrMatcherDeprecated.Matches the String trim() whitespace characters.
- 
Constructor Details- 
StrMatcherprotected StrMatcher()Deprecated.Constructs a new instance.
 
- 
- 
Method Details- 
charMatcherDeprecated.Constructor that creates a matcher from a character.- Parameters:
- ch- the character to match, must not be null
- Returns:
- a new Matcher for the given char
 
- 
charSetMatcherDeprecated.Constructor that creates a matcher from a set of characters.- Parameters:
- chars- the characters to match, null or empty matches nothing
- Returns:
- a new matcher for the given char[]
 
- 
charSetMatcherDeprecated.Constructor that creates a matcher from a string representing a set of characters.- Parameters:
- chars- the characters to match, null or empty matches nothing
- Returns:
- a new Matcher for the given characters
 
- 
commaMatcherDeprecated.Returns a matcher which matches the comma character.- Returns:
- a matcher for a comma
 
- 
doubleQuoteMatcherDeprecated.Returns a matcher which matches the double quote character.- Returns:
- a matcher for a double quote
 
- 
noneMatcherDeprecated.Matches no characters.- Returns:
- a matcher that matches nothing
 
- 
quoteMatcherDeprecated.Returns a matcher which matches the single or double quote character.- Returns:
- a matcher for a single or double quote
 
- 
singleQuoteMatcherDeprecated.Returns a matcher which matches the single quote character.- Returns:
- a matcher for a single quote
 
- 
spaceMatcherDeprecated.Returns a matcher which matches the space character.- Returns:
- a matcher for a space
 
- 
splitMatcherDeprecated.Matches the same characters as StringTokenizer, namely space, tab, newline and formfeed.- Returns:
- the split matcher
 
- 
stringMatcherDeprecated.Constructor that creates a matcher from a string.- Parameters:
- str- the string to match, null or empty matches nothing
- Returns:
- a new Matcher for the given String
 
- 
tabMatcherDeprecated.Returns a matcher which matches the tab character.- Returns:
- a matcher for a tab
 
- 
trimMatcherDeprecated.Matches the String trim() whitespace characters.- Returns:
- the trim matcher
 
- 
isMatchDeprecated.Returns the number of matching characters, zero for no match.This method is called to check for a match. The parameter posrepresents the current position to be checked in the stringbuffer(a character array which must not be changed). The API guarantees thatposis a valid index forbuffer.The matching code may check one character or many. It may check characters preceding posas 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- the text content to match against, do not change
- pos- the starting position for the match, valid for buffer
- Returns:
- the number of matching characters, zero for no match
- Since:
- 2.4
 
- 
isMatchDeprecated.Returns the number of matching characters, zero for no match.This method is called to check for a match. The parameter posrepresents the current position to be checked in the stringbuffer(a character array which must not be changed). The API guarantees thatposis a valid index forbuffer.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 posas 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- 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 (exclusive) of the active buffer, valid for buffer
- Returns:
- the number of matching characters, zero for no match
 
 
-