public class StringFilter extends org.pfsw.text.StringPattern implements IStringChecker
Modifier and Type | Field and Description |
---|---|
protected static char |
DIGIT_WILDCARD_CHAR |
protected static java.lang.String |
EXCLUDE_OFF |
protected static java.lang.String |
EXCLUDE_ON |
protected static boolean |
SUPPORT_EMPTY_STRING_MATCH |
DEFAULT_MULTICHAR_WILDCARD, DEFAULT_SINGLECHAR_WILDCARD, SWITCH_OFF, SWITCH_ON
ALL_MATCHING, NONE_MATCHING
Constructor and Description |
---|
StringFilter(java.lang.String pattern)
Initializes the new instance with the string pattern.
|
StringFilter(java.lang.String pattern,
boolean ignoreCase)
Initializes the new instance with the string pattern and the selecteion,
if case should be ignored when comparing characters.
|
StringFilter(java.lang.String pattern,
boolean ignoreCase,
boolean active)
Initializes the new instance with the string pattern and the selection,
if case should be ignored when comparing characters.
|
StringFilter(java.lang.String pattern,
boolean ignoreCase,
char digitWildcard)
Initializes the new instance with the string pattern and the selecteion,
if case should be ignored when comparing characters plus a wildcard
character for digits.
|
StringFilter(java.lang.String pattern,
char digitWildcard)
Initializes the new instance with the string pattern and a digit wildcard
character.
|
Modifier and Type | Method and Description |
---|---|
void |
appendToBuffer(java.lang.StringBuffer buffer)
Append this filter's string representation to the given buffer.
|
StringFilter |
copy()
Returns a new object that is an exact copy of this string filter.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
isActive()
Returns whether or not this filter is currently active
|
protected java.lang.String |
isActiveAsString() |
boolean |
isExclude()
Returns true if this filter is an exclude filter.
|
protected java.lang.String |
isExcludeAsString() |
boolean |
matches(java.lang.String probe)
Tests if the given string matches the pattern.
|
void |
setActive(boolean active)
Sets whether or not this filter is currently active.
|
void |
setExclude(boolean isExclude)
Sets whether or not this filter matching must be treated as exclude filter.
|
java.lang.String |
toString() |
appendAsJSONString, charsAreEqual, containsWildcard, create, create, create, create, digitWildcard, digitWildcard, digitWildcardChar, endNotReached, endReached, eventuallyMatched, getDefaultMultiCharWildcard, getDefaultSingleCharWildcard, getIgnoreCase, getMultiCharWildcard, getPattern, getPatternChar, getSingleCharWildcard, hasDigitWildcard, hasWildcard, ignoreCaseAsString, inspectString, match, matchIgnoreCase, matchReverse, multiCharWildcardMatchesEmptyString, multiCharWildcardMatchesEmptyString, newExaminer, reject, select, selectOrReject, setDigitWildcardChar, setIgnoreCase, setMultiCharWildcard, setPattern, setSingleCharWildcard, skipAfter, skipWildcards, strUtil, toJSON, upToEnd
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
test
protected static final boolean SUPPORT_EMPTY_STRING_MATCH
protected static final char DIGIT_WILDCARD_CHAR
protected static final java.lang.String EXCLUDE_ON
protected static final java.lang.String EXCLUDE_OFF
public StringFilter(java.lang.String pattern, boolean ignoreCase, boolean active)
pattern
- The pattern to check against ( May contain '*' and '?' wildcards )ignoreCase
- Definition, if case sensitive character comparison or not.active
- Defines whether or not the filter is initially active.public StringFilter(java.lang.String pattern, boolean ignoreCase)
pattern
- The pattern to check against ( May contain '*' and '?' wildcards )ignoreCase
- Definition, if case sensitive character comparison or not.public StringFilter(java.lang.String pattern)
pattern
- The pattern to check against ( May contain '*' and '?' wildcards )public StringFilter(java.lang.String pattern, char digitWildcard)
pattern
- The pattern to check against ( May contain '*', '?' wildcards and the digit wildcard )digitWildcard
- A wildcard character that stands as placeholder for digitspublic StringFilter(java.lang.String pattern, boolean ignoreCase, char digitWildcard)
pattern
- The pattern to check against ( May contain '*' and '?' wildcards )ignoreCase
- Definition, if case sensitive character comparison or not.digitWildcard
- A wildcard character that stands as placeholder for digitspublic boolean isActive()
public boolean isExclude()
public void setActive(boolean active)
public void setExclude(boolean isExclude)
public boolean matches(java.lang.String probe)
matches
in interface org.pfsw.bif.filter.IObjectFilter<java.lang.String>
matches
in interface org.pfsw.bif.text.IStringFilter
matches
in class org.pfsw.text.StringPattern
probe
- The string to compare to the patternpublic boolean equals(java.lang.Object obj)
equals
in class org.pfsw.text.StringPattern
public int hashCode()
hashCode
in class org.pfsw.text.StringPattern
public java.lang.String toString()
toString
in class org.pfsw.text.StringPattern
public void appendToBuffer(java.lang.StringBuffer buffer)
public StringFilter copy()
copy
in class org.pfsw.text.StringPattern
protected java.lang.String isActiveAsString()
protected java.lang.String isExcludeAsString()