Deprecated
Deprecated as of 1.3, use StringMatcherFactory instead. This class will be removed in 2.0.
This class comes complete with various factory methods. If these do not suffice, you can subclass and implement your own matcher.
| Modifier and Type | Class and Description |
|---|---|
| private static class | StrMatcher.
References Deprecated
Class used to define a character for matching purposes.
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
|
| private static class | StrMatcher.
References Deprecated
Class used to define a set of characters for matching purposes.
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
|
| private static class | StrMatcher.
References Deprecated
Class used to match no characters.
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
|
| private static class | StrMatcher.
References Deprecated
Class used to define a set of characters for matching purposes.
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
|
| private static class | StrMatcher.
References Deprecated
Class used to match whitespace as per trim().
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
|
| Modifier and Type | Field and Description |
|---|---|
| private static final StrMatcher | COMMA_MATCHER
References Deprecated
Matches the comma character.
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
|
| private static final StrMatcher | DOUBLE_QUOTE_MATCHER
References Deprecated
Matches the double quote character.
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
|
| private static final StrMatcher | NONE_MATCHER
References Deprecated
Matches no characters.
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
|
| private static final StrMatcher | QUOTE_MATCHER
References Deprecated
Matches the single or double quote character.
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
|
| private static final StrMatcher | SINGLE_QUOTE_MATCHER
References Deprecated
Matches the double quote character.
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
|
| private static final StrMatcher | SPACE_MATCHER
References Deprecated
Matches the space character.
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
|
| private static final StrMatcher | SPLIT_MATCHER
References Deprecated
Matches the same characters as StringTokenizer,
namely space, tab, newline, form feed.
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
|
| private static final StrMatcher | TAB_MATCHER
References Deprecated
Matches the tab character.
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
|
| private static final StrMatcher | TRIM_MATCHER
References Deprecated
Matches the String trim() whitespace characters.
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
|
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static StrMatcher | Returns: a new Matcher for the given 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[].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.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: a matcher for a comma.
References Deprecated
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Returns a matcher which matches the comma character. |
| public static StrMatcher | Returns: a matcher for a double quote.
References Deprecated
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Returns a matcher which matches the double quote character. |
| public int | Returns: The number of matching characters, or zero if there is no match.the text content to match against, do not change. buffer, final int the starting position for the match, valid for buffer. pos)Returns the number of matching characters, or zero if there is no match. |
| public abstract int | Returns: The number of matching characters, or zero if there is no match.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)Returns the number of matching characters, or zero if there is no match. |
| public static StrMatcher | Returns: a matcher that matches nothing.
References Deprecated
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Matches no characters. |
| public static StrMatcher | Returns: a matcher for a single or double quote.
References Deprecated
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Returns a matcher which matches the single or double quote character. |
| public static StrMatcher | Returns: a matcher for a single quote.
References Deprecated
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Returns a matcher which matches the single quote character. |
| public static StrMatcher | Returns: a matcher for a space.
References Deprecated
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Returns a matcher which matches the space character. |
| public static StrMatcher | Returns: The 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 and form feed. |
| public static StrMatcher | Returns: a new Matcher for the given Stringthe 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 from a string. |
| public static StrMatcher | Returns: a matcher for a tab.
References Deprecated
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Returns a matcher which matches the tab character. |
| public static StrMatcher | Returns: The trim matcher.
References Deprecated
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
Matches the String trim() whitespace characters. |
| COMMA_MATCHER | back to summary |
|---|---|
| private static final StrMatcher COMMA_MATCHER
References Deprecated
See corresponding docs for further information. Matches the comma character. | |
| DOUBLE_QUOTE_MATCHER | back to summary |
|---|---|
| private static final StrMatcher DOUBLE_QUOTE_MATCHER
References Deprecated
See corresponding docs for further information. Matches the double quote character. | |
| NONE_MATCHER | back to summary |
|---|---|
| private static final StrMatcher NONE_MATCHER
References Deprecated
See corresponding docs for further information. Matches no characters. | |
| QUOTE_MATCHER | back to summary |
|---|---|
| private static final StrMatcher QUOTE_MATCHER
References Deprecated
See corresponding docs for further information. Matches the single or double quote character. | |
| SINGLE_QUOTE_MATCHER | back to summary |
|---|---|
| private static final StrMatcher SINGLE_QUOTE_MATCHER
References Deprecated
See corresponding docs for further information. Matches the double quote character. | |
| SPACE_MATCHER | back to summary |
|---|---|
| private static final StrMatcher SPACE_MATCHER
References Deprecated
See corresponding docs for further information. Matches the space character. | |
| SPLIT_MATCHER | back to summary |
|---|---|
| private static final StrMatcher SPLIT_MATCHER
References Deprecated
See corresponding docs for further information. Matches the same characters as StringTokenizer, namely space, tab, newline, form feed. | |
| TAB_MATCHER | back to summary |
|---|---|
| private static final StrMatcher TAB_MATCHER
References Deprecated
See corresponding docs for further information. Matches the tab character. | |
| TRIM_MATCHER | back to summary |
|---|---|
| private static final StrMatcher TRIM_MATCHER
References Deprecated
See corresponding docs for further information. Matches the String trim() whitespace characters. | |
| StrMatcher | back to summary |
|---|---|
| protected StrMatcher() Constructs a new instance. | |
| charMatcher | back to summary |
|---|---|
| public static StrMatcher charMatcher(final char ch)
References Deprecated
See corresponding docs for further information. Creates a matcher from a character.
| |
| charSetMatcher | back to summary |
|---|---|
| public static StrMatcher charSetMatcher(final char... chars)
References Deprecated
See corresponding docs for further information. Creates a matcher from a set of characters.
| |
| charSetMatcher | back to summary |
|---|---|
| public static StrMatcher charSetMatcher(final String chars)
References Deprecated
See corresponding docs for further information. Creates a matcher from a string representing a set of characters.
| |
| commaMatcher | back to summary |
|---|---|
| public static StrMatcher commaMatcher()
References Deprecated
See corresponding docs for further information. Returns a matcher which matches the comma character.
| |
| doubleQuoteMatcher | back to summary |
|---|---|
| public static StrMatcher doubleQuoteMatcher()
References Deprecated
See corresponding docs for further information. Returns a matcher which matches the double quote character.
| |
| isMatch | back to summary |
|---|---|
| public int isMatch(final char[] buffer, final int pos) Returns the number of matching characters, or zero if there is no match.
This method is called to check for a match.
The parameter
The matching code may check one character or many.
It may check characters preceding 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.
| |
| isMatch | back to summary |
|---|---|
| public abstract int isMatch(char[] buffer, int pos, int bufferStart, int bufferEnd) Returns the number of matching characters, or zero if there is no match.
This method is called to check for a match.
The parameter 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 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.
| |
| noneMatcher | back to summary |
|---|---|
| public static StrMatcher noneMatcher()
References Deprecated
See corresponding docs for further information. Matches no characters.
| |
| quoteMatcher | back to summary |
|---|---|
| public static StrMatcher quoteMatcher()
References Deprecated
See corresponding docs for further information. Returns a matcher which matches the single or double quote character.
| |
| singleQuoteMatcher | back to summary |
|---|---|
| public static StrMatcher singleQuoteMatcher()
References Deprecated
See corresponding docs for further information. Returns a matcher which matches the single quote character.
| |
| spaceMatcher | back to summary |
|---|---|
| public static StrMatcher spaceMatcher()
References Deprecated
See corresponding docs for further information. Returns a matcher which matches the space character.
| |
| splitMatcher | back to summary |
|---|---|
| public static StrMatcher splitMatcher()
References Deprecated
See corresponding docs for further information. Matches the same characters as StringTokenizer, namely space, tab, newline and form feed.
| |
| stringMatcher | back to summary |
|---|---|
| public static StrMatcher stringMatcher(final String str)
References Deprecated
See corresponding docs for further information. Creates a matcher from a string.
| |
| tabMatcher | back to summary |
|---|---|
| public static StrMatcher tabMatcher()
References Deprecated
See corresponding docs for further information. Returns a matcher which matches the tab character.
| |
| trimMatcher | back to summary |
|---|---|
| public static StrMatcher trimMatcher()
References Deprecated
See corresponding docs for further information. Matches the String trim() whitespace characters.
| |
References Deprecated
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
See corresponding docs for further information.
| Modifier and Type | Field and Description |
|---|---|
| private final char | ch
The character to match. |
| Access | Constructor and Description |
|---|---|
| private | CharMatcher(final char
the character to match. ch)Constructor that creates a matcher that matches a single character. |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: The number of matching characters, or zero if there is no match.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. Returns |
| ch | back to summary |
|---|---|
| private final char ch The character to match. | |
| CharMatcher | back to summary |
|---|---|
| private CharMatcher(final char ch) Constructor that creates a matcher that matches a single character.
| |
| isMatch | back to summary |
|---|---|
| public int isMatch(final char[] buffer, final int pos, final int bufferStart, final int bufferEnd) Implements abstract org. Returns
| |
References Deprecated
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
See corresponding docs for further information.
| Modifier and Type | Field and Description |
|---|---|
| private final char[] | chars
The set of characters to match. |
| Access | Constructor and Description |
|---|---|
| private | CharSetMatcher(final char[]
the characters to match, must not be null chars)Constructor that creates a matcher from a character array. |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: The number of matching characters, or zero if there is no match.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. Returns |
| chars | back to summary |
|---|---|
| private final char[] chars The set of characters to match. | |
| CharSetMatcher | back to summary |
|---|---|
| private CharSetMatcher(final char[] chars) Constructor that creates a matcher from a character array.
| |
| isMatch | back to summary |
|---|---|
| public int isMatch(final char[] buffer, final int pos, final int bufferStart, final int bufferEnd) Implements abstract org. Returns
| |
References Deprecated
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
See corresponding docs for further information.
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: The number of matching characters, or zero if there is no match.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. Always returns |
| NoMatcher | back to summary |
|---|---|
| private NoMatcher() Constructs a new instance of | |
| isMatch | back to summary |
|---|---|
| public int isMatch(final char[] buffer, final int pos, final int bufferStart, final int bufferEnd) Implements abstract org. Always returns
| |
References Deprecated
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
See corresponding docs for further information.
| Modifier and Type | Field and Description |
|---|---|
| private final char[] | chars
The string to match, as a character array. |
| Access | Constructor and Description |
|---|---|
| private | StringMatcher(final String
the string to match, must not be null str)Constructor that creates a matcher from a String. |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: The number of matching characters, or zero if there is no match.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. Returns the number of matching characters, or zero if there is no match. |
| public String |
| chars | back to summary |
|---|---|
| private final char[] chars The string to match, as a character array. | |
| StringMatcher | back to summary |
|---|---|
| private StringMatcher(final String str) Constructor that creates a matcher from a String.
| |
| isMatch | back to summary |
|---|---|
| public int isMatch(final char[] buffer, int pos, final int bufferStart, final int bufferEnd) Implements abstract org. Returns the number of matching characters, or zero if there is no match.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
References Deprecated
StrMatcher is deprecated or references (maybe indirectly) at least one deprecated element.
See corresponding docs for further information.
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: The number of matching characters, or zero if there is no match.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. Returns whether or not the given character matches. |
| TrimMatcher | back to summary |
|---|---|
| private TrimMatcher() Constructs a new instance of | |
| isMatch | back to summary |
|---|---|
| public int isMatch(final char[] buffer, final int pos, final int bufferStart, final int bufferEnd) Implements abstract org. Returns whether or not the given character matches.
| |