net.sf.molae.pipe.filter
Class TransformedFilter<S,T>

java.lang.Object
  extended by net.sf.molae.pipe.filter.TransformedFilter<S,T>
All Implemented Interfaces:
TypedPredicate<T>

public final class TransformedFilter<S,T>
extends Object
implements TypedPredicate<T>

Calls a transformer before calling the predicate.


Constructor Summary
TransformedFilter(TypedPredicate<S> predicate, TwoWayTransformer<? super T,? extends S> transformer)
          Constructs a TransformedFilter object.
 
Method Summary
 boolean evaluate(T input)
          Returns the evaluation of the transformed input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransformedFilter

public TransformedFilter(TypedPredicate<S> predicate,
                         TwoWayTransformer<? super T,? extends S> transformer)
Constructs a TransformedFilter object.

Parameters:
predicate - base predicate
transformer - base transformer
Throws:
NullPointerException - if the specified objects are null.
Method Detail

evaluate

public boolean evaluate(T input)
Returns the evaluation of the transformed input. Performs two steps:
  1. It transforms the input with the underlying transformer,
  2. then it evaluates the transformed input by the underlying predicate.

Specified by:
evaluate in interface TypedPredicate<T>
Parameters:
input - object to evaluate.
Returns:
the evaluation of the transformed input.