A - the procedure argument type.public final class CompositeUnaryProcedure<A> extends Object implements UnaryProcedure<A>, Serializable
UnaryProcedure
representing the composition of
UnaryFunctions,
"chaining" the output of one to the input
of another. For example,
new CompositeUnaryProcedure(p).of(f)
runs to
p.run(f.evaluate(obj)), and
new CompositeUnaryProcedure(p).of(f).of(g)
runs
p.run(f.evaluate(g.evaluate(obj))).
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 |
|---|
CompositeUnaryProcedure(UnaryProcedure<? super A> procedure)
Create a new CompositeUnaryProcedure.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(CompositeUnaryProcedure<?> that)
Learn whether another CompositeUnaryProcedure is equal to this.
|
boolean |
equals(Object that) |
int |
hashCode() |
<T> CompositeUnaryProcedure<T> |
of(UnaryFunction<? super T,? extends A> preceding)
Fluently obtain a CompositeUnaryProcedure that runs our procedure against the result of the preceding function.
|
void |
run(A obj)
Execute this procedure.
|
String |
toString() |
public CompositeUnaryProcedure(UnaryProcedure<? super A> procedure)
procedure - final UnaryProcedure to runpublic <T> CompositeUnaryProcedure<T> of(UnaryFunction<? super T,? extends A> preceding)
T - the input function left argument and output procedure argument typepreceding - UnaryFunctionpublic void run(A obj)
run in interface UnaryProcedure<A>obj - an A parameter to this executionpublic boolean equals(CompositeUnaryProcedure<?> that)
that - CompositeUnaryProcedure to testCopyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.