L - the left argument type.R - the right argument type.T - the output function returned value type.public final class ConditionalBinaryFunction<L,R,T> extends Object implements BinaryFunction<L,R,T>
BinaryFunction
similiar to Java's "ternary"
or "conditional" operator (? :).
Given a predicate
p and functions
f and g, evaluates
to
p.test(x,y) ? f.evaluate(x,y) : g.evaluate(x,y).| Constructor and Description |
|---|
ConditionalBinaryFunction(BinaryPredicate<? super L,? super R> ifPred,
BinaryFunction<? super L,? super R,? extends T> thenFunc,
BinaryFunction<? super L,? super R,? extends T> elseFunc)
Create a new ConditionalBinaryFunction.
|
public ConditionalBinaryFunction(BinaryPredicate<? super L,? super R> ifPred, BinaryFunction<? super L,? super R,? extends T> thenFunc, BinaryFunction<? super L,? super R,? extends T> elseFunc)
ifPred - ifthenFunc - thenelseFunc - elsepublic T evaluate(L left, R right)
evaluate in interface BinaryFunction<L,R,T>left - the L element of the ordered pair of argumentsright - the R element of the ordered pair of argumentsCopyright © 2003–2014 The Apache Software Foundation. All rights reserved.