A - the argument type.T - the returned value type.public class CompositeUnaryFunction<A,T> extends Object implements UnaryFunction<A,T>, Serializable
UnaryFunction
representing the composition of
UnaryFunctions,
"chaining" the output of one to the input
of another. For example,
new CompositeUnaryFunction(f).of(g)
evaluates to
f.evaluate(g.evaluate(obj)), and
new CompositeUnaryFunction(f).of(g).of(h)
evaluates to
f.evaluate(g.evaluate(h.evaluate(obj))).
When the collection is empty, this function is an identity function.
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 |
|---|
CompositeUnaryFunction(UnaryFunction<? super A,? extends T> function)
Create a new CompositeUnaryFunction.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(CompositeUnaryFunction<?,?> that)
Learn whether another CompositeUnaryFunction is equal to this.
|
boolean |
equals(Object that) |
T |
evaluate(A obj)
Evaluate this function.
|
int |
hashCode() |
<P> CompositeUnaryFunction<P,T> |
of(UnaryFunction<? super P,? extends A> preceding)
Fluently obtain a CompositeUnaryFunction that is "this function" applied to the specified preceding function.
|
String |
toString() |
public CompositeUnaryFunction(UnaryFunction<? super A,? extends T> function)
function - UnaryFunction to callpublic final T evaluate(A obj)
evaluate in interface UnaryFunction<A,T>obj - the A object to evaluatepublic final <P> CompositeUnaryFunction<P,T> of(UnaryFunction<? super P,? extends A> preceding)
P - argument type of the resulting function.preceding - UnaryFunctionpublic final boolean equals(CompositeUnaryFunction<?,?> that)
that - CompositeUnaryFunction to testCopyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.