L - the left argument type.R - the right argument type.public final class ConditionalBinaryPredicate<L,R> extends Object implements BinaryPredicate<L,R>, Serializable
BinaryPredicate
similiar to Java's "ternary"
or "conditional" operator (? :).
Given three predicates
p, q, r,
tests
to
p.test(x,y) ? q.test(x,y) : r.test(x,y).
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 |
|---|
ConditionalBinaryPredicate(BinaryPredicate<? super L,? super R> ifPred,
BinaryPredicate<? super L,? super R> thenPred,
BinaryPredicate<? super L,? super R> elsePred)
Create a new ConditionalBinaryPredicate.
|
public ConditionalBinaryPredicate(BinaryPredicate<? super L,? super R> ifPred, BinaryPredicate<? super L,? super R> thenPred, BinaryPredicate<? super L,? super R> elsePred)
ifPred - ifthenPred - thenelsePred - elsepublic boolean test(L left, R right)
test in interface BinaryPredicate<L,R>left - the L element of the ordered pair of argumentsright - the R element of the ordered pair of argumentspublic boolean equals(ConditionalBinaryPredicate<?,?> that)
that - ConditionalBinaryPredicate to testCopyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.