- All Implemented Interfaces:
Filter<T>
public class OrFilter<T>
extends Object
implements Filter<T>
Filter that evalutes to true if any of its component filters evaluate to true.
If the filter is empty, then this also returns true.
- Author:
- Nick Collier
-
Constructor Summary
Constructors
Creates an empty OrFilter.
Creates an OrFilter composed of the specified filters.
-
Method Summary
void
Add the specified filter to this OrFilter.
boolean
Gets an iterable over the filters that compose this OrFilter.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
OrFilter
public OrFilter()
Creates an empty OrFilter.
-
OrFilter
public OrFilter(Filter<T>... filters)
Creates an OrFilter composed of the specified filters.
- Parameters:
filters
- the filters to add
-
Method Details
-
addFilter
public void addFilter(Filter<T> filter)
Add the specified filter to this OrFilter.
- Parameters:
filter
- the filter to add
-
filters
Gets an iterable over the filters that compose this OrFilter.
- Returns:
- an iterable over the filters that compose this OrFilter.
-
evaluate
public boolean evaluate(T object)
- Specified by:
evaluate
in interface Filter<T>