|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.core.closure.support.ClosureChain
public class ClosureChain
A chain of closures that evaluate their results in a ordered sequence.
For example, declaring
new ClosureChain() { f1, f2, f3 }.call(fooArg)
will trigger
the evaluation of f1
first, it's result will be passed to
f2
for evaluation, and f2's result will be passed to
f3
for evaluation. The final f3 result will be returned to the
caller.
Constructor Summary | |
---|---|
ClosureChain()
Constructs a function chain with no initial members. |
|
ClosureChain(Closure[] functions)
Creates a chain composed of the ordered array of functions. |
|
ClosureChain(Closure function1,
Closure function2)
Creates a chain composed of two functions. |
Method Summary | |
---|---|
ClosureChain |
add(Closure function)
Add the specified function to the set of functions aggregated by this function chain. |
Object |
call(Object argument)
Evaluate the function with the provided argument, returning the result. |
Iterator |
iterator()
Return an iterator over the aggregated predicates. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ClosureChain()
public ClosureChain(Closure function1, Closure function2)
function1
- the first functionfunction2
- the second functionpublic ClosureChain(Closure[] functions)
functions
- the aggregated functionsMethod Detail |
---|
public ClosureChain add(Closure function)
function
- the function to add
public Iterator iterator()
public Object call(Object argument)
call
in interface Closure
argument
- the argument
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |