A
- the argument type.T
- the returned value type.public class CompositeFunction<A,T> extends Object implements Function<A,T>
Function
representing the composition of
Functions
,
"chaining" the output of one to the input
of another. For example,
new CompositeFunction(f).of(g)
evaluates
to
f.evaluate(g.evaluate(obj))
, and
new CompositeFunction(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.
Constructor and Description |
---|
CompositeFunction(Function<? super A,? extends T> function)
Create a new CompositeFunction.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
T |
evaluate(A obj)
Evaluate this function.
|
int |
hashCode() |
<P> CompositeFunction<P,T> |
of(Function<? super P,? extends A> preceding)
Fluently obtain a CompositeFunction that is "this function" applied to the specified preceding function.
|
String |
toString() |
public CompositeFunction(Function<? super A,? extends T> function)
function
- Function to callpublic final <P> CompositeFunction<P,T> of(Function<? super P,? extends A> preceding)
P
- argument type of the resulting function.preceding
- FunctionCopyright © 2003–2014 The Apache Software Foundation. All rights reserved.