T
- the returned value type.public final class ConditionalNullaryFunction<T> extends Object implements NullaryFunction<T>
NullaryFunction
similiar to Java's "ternary"
or "conditional" operator (? :
).
Given a predicate
p and functions
f and g, evaluates
to
p.test() ? f.evaluate() : g.evaluate()
.Constructor and Description |
---|
ConditionalNullaryFunction(NullaryPredicate ifPred,
NullaryFunction<? extends T> thenFunc,
NullaryFunction<? extends T> elseFunc)
Create a new ConditionalNullaryFunction.
|
public ConditionalNullaryFunction(NullaryPredicate ifPred, NullaryFunction<? extends T> thenFunc, NullaryFunction<? extends T> elseFunc)
ifPred
- ifthenFunc
- thenelseFunc
- elsepublic T evaluate()
evaluate
in interface NullaryFunction<T>
Copyright © 2003–2014 The Apache Software Foundation. All rights reserved.