Package jadex.commons
Class ComposedRemoteFilter<T>
- java.lang.Object
-
- jadex.commons.ComposedRemoteFilter<T>
-
- All Implemented Interfaces:
IAsyncFilter<T>
,java.io.Serializable
public class ComposedRemoteFilter<T> extends java.lang.Object implements IAsyncFilter<T>, java.io.Serializable
A filter checks if an object matches the given subfilters.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jadex.commons.IAsyncFilter
IAsyncFilter.AlwaysFilter<E>, IAsyncFilter.NeverFilter<E>
-
-
Field Summary
Fields Modifier and Type Field Description static int
AND
The AND operator.protected IAsyncFilter[]
filters
The filtersstatic int
NOT
The NOT operator.protected int
operator
The operator.static int
OR
The OR operator.-
Fields inherited from interface jadex.commons.IAsyncFilter
ALWAYS, NEVER
-
-
Constructor Summary
Constructors Constructor Description ComposedRemoteFilter(IAsyncFilter<T>[] filters)
Create a composed filter.ComposedRemoteFilter(IAsyncFilter<T>[] filters, int operator)
Create a composed filter.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFilter(IAsyncFilter<T> filter)
Add a filter.protected IFuture<java.lang.Boolean>
checkAndFilter(java.lang.Object object, IAsyncFilter[] filter, int i)
Check and filter.protected IFuture<java.lang.Boolean>
checkOrFilter(java.lang.Object object, IAsyncFilter[] filter, int i)
Check or filter.boolean
equals(java.lang.Object obj)
Test if an object is equal to this.IFuture<java.lang.Boolean>
filter(java.lang.Object object)
Match an object against the filter.IAsyncFilter[]
getFilters()
Get the filters.int
getOperator()
Get the operator.int
hashCode()
Get the hashcode.static java.lang.String
operatorToString(int operator)
Create a string representation of the operator.void
setFilters(IAsyncFilter<T>[] filters)
Set the filters.void
setOperator(int operator)
Set the operator.java.lang.String
toString()
Create a string representation of this filter.
-
-
-
Field Detail
-
AND
public static final int AND
The AND operator.- See Also:
- Constant Field Values
-
OR
public static final int OR
The OR operator.- See Also:
- Constant Field Values
-
NOT
public static final int NOT
The NOT operator.- See Also:
- Constant Field Values
-
filters
protected IAsyncFilter[] filters
The filters
-
operator
protected int operator
The operator.
-
-
Constructor Detail
-
ComposedRemoteFilter
public ComposedRemoteFilter(IAsyncFilter<T>[] filters)
Create a composed filter.- Parameters:
filters
- The filters.operator
- The operator.
-
ComposedRemoteFilter
public ComposedRemoteFilter(IAsyncFilter<T>[] filters, int operator)
Create a composed filter.- Parameters:
filters
- The filters.operator
- The operator.
-
-
Method Detail
-
filter
public IFuture<java.lang.Boolean> filter(java.lang.Object object)
Match an object against the filter.- Specified by:
filter
in interfaceIAsyncFilter<T>
- Parameters:
object
- The object.- Returns:
- True, if the filter matches.
- Throws:
java.lang.Exception
-
checkAndFilter
protected IFuture<java.lang.Boolean> checkAndFilter(java.lang.Object object, IAsyncFilter[] filter, int i)
Check and filter.
-
checkOrFilter
protected IFuture<java.lang.Boolean> checkOrFilter(java.lang.Object object, IAsyncFilter[] filter, int i)
Check or filter.
-
getFilters
public IAsyncFilter[] getFilters()
Get the filters.- Returns:
- the filters.
-
setFilters
public void setFilters(IAsyncFilter<T>[] filters)
Set the filters.- Parameters:
filters
- The filters to set.
-
addFilter
public void addFilter(IAsyncFilter<T> filter)
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.- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
Test if an object is equal to this.- Overrides:
equals
in classjava.lang.Object
-
operatorToString
public static java.lang.String operatorToString(int operator)
Create a string representation of the operator.- Returns:
- A string representing the operator.
-
toString
public java.lang.String toString()
Create a string representation of this filter.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representing this filter.
-
-