|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pfsw.text.AStringFilter
org.pfsw.text.StringCollectionFilter
public class StringCollectionFilter
This filter is based on a collection of strings. It matches all strings that are in the underlying collection. By default it compares case-insensitive. Case sensitivity must be switched on explicitly.
| Field Summary |
|---|
| Fields inherited from interface org.pfsw.bif.text.IStringFilter |
|---|
ALL, NONE |
| Constructor Summary | |
|---|---|
StringCollectionFilter(java.util.Collection<java.lang.String> strings)
Initialize the new instance with a collection of strings. |
|
StringCollectionFilter(java.lang.String strings)
Initialize the new instance with a List of strings provided as one string where the values are separated by comma (","). |
|
StringCollectionFilter(java.lang.String[] strings)
Initialize the new instance with an array of strings. |
|
StringCollectionFilter(java.lang.String strings,
java.lang.String separators)
Initialize the new instance with a List of strings provided as one string where the values are separated by the specified separators. |
|
| Method Summary | |
|---|---|
void |
add(java.lang.String... strings)
Add the given strings to the internal string collection. |
protected void |
addSingleString(java.lang.String string)
Add the given string to the internal string collection. |
static StringCollectionFilter |
create(java.lang.String... strings)
A factory method that supports a variable number of strings. |
boolean |
getIgnoreCase()
Returns true if the string comparison is done case-insensitive |
protected java.lang.String[] |
getInternalStrings()
|
boolean |
matches(java.lang.String string)
Returns true if the given string is in the internal collection of strings. |
boolean |
matchesIfInCollection()
Returns true if this filter matches a string if it is found in the internal collection. |
void |
negate()
Inverts the (match) logic of this filter |
void |
setIgnoreCase(boolean newValue)
Sets whether or not the string comparison is done case-insensitive |
protected void |
setInternalStrings(java.lang.String[] newValue)
|
protected StringUtil |
str()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringCollectionFilter(java.lang.String[] strings)
strings - The strings that define the set that matches this filterpublic StringCollectionFilter(java.util.Collection<java.lang.String> strings)
strings - A list that must only contain String objects
public StringCollectionFilter(java.lang.String strings,
java.lang.String separators)
strings - The strings to add (separated values)separators - Each character is treated as a separator between two string valuespublic StringCollectionFilter(java.lang.String strings)
strings - The strings to add (comma separated values)| Method Detail |
|---|
public static StringCollectionFilter create(java.lang.String... strings)
public boolean matches(java.lang.String string)
string - The string to look up in the collectionpublic void negate()
public boolean matchesIfInCollection()
public void add(java.lang.String... strings)
public boolean getIgnoreCase()
public void setIgnoreCase(boolean newValue)
protected void addSingleString(java.lang.String string)
protected java.lang.String[] getInternalStrings()
protected void setInternalStrings(java.lang.String[] newValue)
protected StringUtil str()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||