net.sf.molae.pipe.filter
Class ContainmentFilter

java.lang.Object
  extended by net.sf.molae.pipe.filter.ContainmentFilter
All Implemented Interfaces:
TypedPredicate<Object>

public final class ContainmentFilter
extends Object
implements TypedPredicate<Object>

Checks for containment in a collection.

Since:
2.0

Constructor Summary
ContainmentFilter(Collection<?> base)
          Constructs a KeyFilter object.
 
Method Summary
 boolean evaluate(Object input)
          Checks if the specified value is contained in the base collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContainmentFilter

public ContainmentFilter(Collection<?> base)
Constructs a KeyFilter object.

Parameters:
base - The collection to be checked for containment.
Throws:
NullPointerException - if the specified object is null.
Method Detail

evaluate

public boolean evaluate(Object input)
Checks if the specified value is contained in the base collection.

Specified by:
evaluate in interface TypedPredicate<Object>
Parameters:
input - a value
Returns:
true, iff the specified object is contained in the base collection.