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 int
The AND operator.The filtersstatic final int
The NOT operator.protected int
The operator.static final int
The 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 TypeMethodDescriptionvoid
Add a filter.boolean
Test if an object is equal to this.boolean
Match an object against the filter.Get the filters.int
Get the operator.int
hashCode()
Get the hashcode.static String
operatorToString
(int operator) Create a string representation of the operator.void
setFilters
(IFilter<T>[] filters) Set the filters.void
setOperator
(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.
-