org.jjoost.util.filters
Class FilterMultiOr<E>

java.lang.Object
  extended by org.jjoost.util.filters.FilterMultiOr<E>
All Implemented Interfaces:
java.io.Serializable, Filter<E>

public class FilterMultiOr<E>
extends java.lang.Object
implements Filter<E>

A filter representing the conjunction (i.e. "and") of the supplied filters. The filters are evaluated in the order they are provided (left-to-right) and are evaluated if and only if no previous filters passed

Author:
b.elliottsmith
See Also:
Serialized Form

Constructor Summary
FilterMultiOr(Filter<? super E>... filters)
          Constructs a new filter representing the conjunction (i.e.
FilterMultiOr(java.lang.Iterable<? extends Filter<? super E>> filters)
          Constructs a new filter representing the conjunction (i.e.
 
Method Summary
 boolean accept(E test)
          Returns true if the Filter accepts the parameter and false otherwise
static
<E> FilterMultiOr<E>
get(Filter<? super E>... filters)
          Returns the conjunction (i.e.
static
<E> FilterMultiOr<E>
get(java.lang.Iterable<? extends Filter<? super E>> filters)
          Returns the conjunction (i.e.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FilterMultiOr

public FilterMultiOr(Filter<? super E>... filters)
Constructs a new filter representing the conjunction (i.e. "and") of the supplied filters

Parameters:
filters - filters to apply

FilterMultiOr

public FilterMultiOr(java.lang.Iterable<? extends Filter<? super E>> filters)
Constructs a new filter representing the conjunction (i.e. "and") of the supplied filters

Parameters:
filters - filters to apply
Method Detail

accept

public boolean accept(E test)
Description copied from interface: Filter
Returns true if the Filter accepts the parameter and false otherwise

Specified by:
accept in interface Filter<E>
Parameters:
test - value to test
Returns:
true if the filter accepts test; false otherwise

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

get

public static <E> FilterMultiOr<E> get(Filter<? super E>... filters)
Returns the conjunction (i.e. "and") of the supplied filters

Parameters:
filters - filters to apply
Returns:
conjunction (i.e. "and") of provided filters

get

public static <E> FilterMultiOr<E> get(java.lang.Iterable<? extends Filter<? super E>> filters)
Returns the conjunction (i.e. "and") of the supplied filters

Parameters:
filters - filters to apply
Returns:
conjunction (i.e. "and") of provided filters