org.apache.commons.collections.functors
Class ChainedClosure
java.lang.Object
org.apache.commons.collections.functors.ChainedClosure
- Closure, Serializable
public class ChainedClosure
extends java.lang.Object
Closure implementation that chains the specified closures together.
$Revision: 1.5 $ $Date: 2004/03/13 17:17:03 $
ChainedClosure
public ChainedClosure(Closure[] closures)
Constructor that performs no validation.
Use getInstance
if you want that.
closures
- the closures to chain, not copied, no nulls
execute
public void execute(Object input)
Execute a list of closures.
- execute in interface Closure
input
- the input object passed to each closure
getClosures
public Closure[] getClosures()
Gets the closures, do not modify the array.
getInstance
public static Closure getInstance(Collection closures)
Create a new Closure that calls each closure in turn, passing the
result into the next closure. The ordering is that of the iterator()
method on the collection.
closures
- a collection of closures to chain
getInstance
public static Closure getInstance(Closure closure1,
Closure closure2)
Factory method that performs validation.
closure1
- the first closure, not nullclosure2
- the second closure, not null
getInstance
public static Closure getInstance(Closure[] closures)
Factory method that performs validation and copies the parameter array.
closures
- the closures to chain, copied, no nulls
Copyright © 2001-2006 Apache Software Foundation. All Rights Reserved.