A - the predicate argument type.public final class ConditionalUnaryPredicate<A> extends Object implements UnaryPredicate<A>, Serializable
UnaryPredicate
similiar to Java's "ternary"
or "conditional" operator (? :).
Given three predicate
p, q, r,
tests
to
p.test(x) ? q.test(x) : r.test(x).
Note that although this class implements
Serializable, a given instance will
only be truly Serializable if all the
underlying functors are. Attempts to serialize
an instance whose delegates are not all
Serializable will result in an exception.
| Constructor and Description |
|---|
ConditionalUnaryPredicate(UnaryPredicate<? super A> ifPred,
UnaryPredicate<? super A> thenPred,
UnaryPredicate<? super A> elsePred)
Create a new ConditionalUnaryPredicate.
|
public ConditionalUnaryPredicate(UnaryPredicate<? super A> ifPred, UnaryPredicate<? super A> thenPred, UnaryPredicate<? super A> elsePred)
ifPred - ifthenPred - thenelsePred - elsepublic boolean test(A obj)
test in interface UnaryPredicate<A>obj - the A object to testpublic boolean equals(ConditionalUnaryPredicate<?> that)
that - ConditionalUnaryPredicate to testCopyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.