public class AndFilter<T> extends CompoundFilter<T>
filter1, filter2
Constructor and Description |
---|
AndFilter(Filter<T> filter1,
Filter<T> filter2)
Creates a new
AndFilter that will "accept" any object that is accept by both of
the specified wrapped filters. |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(T value)
Determines whether the specified object is "accepted" by the filter.
|
static <T> Filter<T> |
and(Filter<T>... filters)
Creates a new
ANDFilter that will "accept" any object that is accept by all of
the specified filters. |
AndFilter<T> |
clone() |
protected java.lang.String |
operatorString()
Returns a string representation of the filter's operator.
|
equals, getFilter1, getFilter2, hashCode, toString
public AndFilter(Filter<T> filter1, Filter<T> filter2)
AndFilter
that will "accept" any object that is accept by both of
the specified wrapped filters.filter1
- The first Filter
that might "accept" any objectfilter2
- The second Filter
that might "accept" any objectpublic static <T> Filter<T> and(Filter<T>... filters)
ANDFilter
that will "accept" any object that is accept by all of
the specified filters.filters
- The list of filters
encapsulated by a chain of AndFilters
AndFilters
that will "accept" any object when all
filters
accepts the objectpublic boolean accept(T value)
value
- The value to filtertrue
if the given value is "accepted" by this filter; false
if it was "rejected"public AndFilter<T> clone()
clone
in class CompoundFilter<T>
protected java.lang.String operatorString()
operatorString
in class CompoundFilter<T>