public class StringFilterCollection extends AStringFilter
IStringFilter
objects that can be matched against
strings according to a defined boolean operator (AND | OR | XOR).Modifier and Type | Field and Description |
---|---|
static BooleanOperation |
DEFAULT_OPERATION |
ALL, NONE
Constructor and Description |
---|
StringFilterCollection()
Creates a new empty instance with default boolean operation
BooleanOperation.OR . |
StringFilterCollection(BooleanOperation operation)
Creates a new empty instance with specified boolean operation
BooleanOperation.OR . |
StringFilterCollection(BooleanOperation operation,
IStringFilter... filters)
Creates a new instance with the specified boolean operation
that will be filled with the given filters.
|
StringFilterCollection(IStringFilter... filters)
Creates a new instance with default boolean operation
BooleanOperation.OR
that will be filled with the given filters. |
Modifier and Type | Method and Description |
---|---|
void |
addFilters(IStringFilter... filters)
Adds all given filters to this collection.
|
java.util.List<IStringFilter> |
asList()
Returns a list with all currently held filters.
|
void |
clear() |
protected java.util.List<IStringFilter> |
getFilterList() |
BooleanOperation |
getOperation() |
boolean |
isEmpty() |
boolean |
matches(java.lang.String aString)
Returns true if the given string matches the filter otherwise false.
|
protected boolean |
matchesAllFilters(java.lang.String aString) |
protected boolean |
matchesAnyFilter(java.lang.String aString) |
protected boolean |
matchesOneFilter(java.lang.String aString) |
void |
setOperation(BooleanOperation operation)
Set the boolean operation the filter results must combined with.
|
int |
size() |
public static final BooleanOperation DEFAULT_OPERATION
public StringFilterCollection()
BooleanOperation.OR
.public StringFilterCollection(BooleanOperation operation)
BooleanOperation.OR
.public StringFilterCollection(IStringFilter... filters)
BooleanOperation.OR
that will be filled with the given filters.public StringFilterCollection(BooleanOperation operation, IStringFilter... filters)
public boolean matches(java.lang.String aString)
IStringFilter
aString
- Any string or even nullpublic void addFilters(IStringFilter... filters)
public int size()
public boolean isEmpty()
public void clear()
public BooleanOperation getOperation()
public void setOperation(BooleanOperation operation)
operation
- The operation (must not be null).java.lang.IllegalArgumentException
- If the given operation is null.public java.util.List<IStringFilter> asList()
protected boolean matchesAnyFilter(java.lang.String aString)
protected boolean matchesAllFilters(java.lang.String aString)
protected boolean matchesOneFilter(java.lang.String aString)
protected java.util.List<IStringFilter> getFilterList()