|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.collections15.functors.predicate.TransformerPredicate<E>
public final class TransformerPredicate<E>
Predicate
implementation that wraps a Transformer
whose output type is Boolean
. The Predicate
evaluates true
if the Transformer
returns
Boolean.TRUE
, and evaluates to false
if the
Transformer
returns Boolean.False
or
null
.
Constructor Summary | |
---|---|
protected |
TransformerPredicate(Transformer<E,java.lang.Boolean> transformer)
Creates a new instance that evaluates input objects using the specified Transformer . |
Method Summary | ||
---|---|---|
boolean |
evaluate(E object)
Evaluates the Predicate returning the result of the wrapped
Transformer . |
|
static
|
getInstance(Transformer<T,java.lang.Boolean> transformer)
Returns an instance that evaluates input objects using the specified Transformer . |
|
Transformer<E,java.lang.Boolean> |
getTransformer()
Returns the underlying Transformer . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected TransformerPredicate(Transformer<E,java.lang.Boolean> transformer)
Transformer
.
transformer
- The Transformer
to use.
java.lang.IllegalArgumentException
- Thrown if the transformer
argument is null
.Method Detail |
---|
public static <T> Predicate<T> getInstance(Transformer<T,java.lang.Boolean> transformer)
Transformer
.
transformer
- The Transformer
to use.
Predicate
that evaluates input objects using the
specified Transformer
.
java.lang.IllegalArgumentException
- Thrown if the transformer
argument is null
.public boolean evaluate(E object)
Predicate
returning the result of the wrapped
Transformer
.
evaluate
in interface Predicate<E>
object
- The input object yo evaluate.
true
if the underlying Transformer
returns Boolean.TRUE
. false
if the
underlying Transformer
returns Boolean.FALSE
or null
.public Transformer<E,java.lang.Boolean> getTransformer()
Transformer
.
Transformer
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |