Package jadex.common
Class ComposedFilter<T>
java.lang.Object
jadex.common.ComposedFilter<T>
- All Implemented Interfaces:
IFilter<T>,Serializable
A filter checks if an object matches
the given subfilters.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe AND operator.The filtersstatic final intThe NOT operator.protected intThe operator.static final intThe OR operator. -
Constructor Summary
ConstructorsConstructorDescriptionCreate a composed filter.ComposedFilter(IFilter<T>... filters) Create a composed filter.ComposedFilter(IFilter<T>[] filters, int operator) Create a composed filter. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a filter.booleanTest if an object is equal to this.booleanMatch an object against the filter.Get the filters.intGet the operator.inthashCode()Get the hashcode.static StringoperatorToString(int operator) Create a string representation of the operator.voidsetFilters(IFilter<T>[] filters) Set the filters.voidsetOperator(int operator) Set the operator.toString()Create a string representation of this filter.
-
Field Details
-
AND
public static final int ANDThe AND operator.- See Also:
-
OR
public static final int ORThe OR operator.- See Also:
-
NOT
public static final int NOTThe NOT operator.- See Also:
-
filters
The filters -
operator
protected int operatorThe operator.
-
-
Constructor Details
-
ComposedFilter
public ComposedFilter()Create a composed filter.- Parameters:
filters- The filters.operator- The operator.
-
ComposedFilter
Create a composed filter.- Parameters:
filters- The filters.operator- The operator.
-
ComposedFilter
Create a composed filter.- Parameters:
filters- The filters.operator- The operator.
-
-
Method Details
-
filter
Match an object against the filter. -
getFilters
Get the filters.- Returns:
- the filters.
-
setFilters
Set the filters.- Parameters:
filters- The filters to set.
-
addFilter
Add a filter.- Parameters:
filter- The filter.
-
getOperator
public int getOperator()Get the operator.- Returns:
- the operator.
-
setOperator
public void setOperator(int operator) Set the operator.- Parameters:
operator- The operator to set.
-
hashCode
public int hashCode()Get the hashcode. -
equals
Test if an object is equal to this. -
operatorToString
Create a string representation of the operator.- Returns:
- A string representing the operator.
-
toString
Create a string representation of this filter.
-