Class ChainedClosure<E>
java.lang.Object
org.apache.commons.collections4.functors.ChainedClosure<E>
- All Implemented Interfaces:
Serializable, Closure<E>
Closure implementation that chains the specified closures together.
- Since:
- 3.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe closures to call in turnprivate static final longSerial version UID -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateChainedClosure(boolean clone, Closure<? super E>... closures) Hidden constructor for the use by the static factory methods.ChainedClosure(Closure<? super E>... closures) Constructor that performs no validation. -
Method Summary
Modifier and TypeMethodDescriptionstatic <E> Closure<E> chainedClosure(Collection<? extends Closure<? super E>> closures) Create a new Closure that calls each closure in turn, passing the result into the next closure.static <E> Closure<E> chainedClosure(Closure<? super E>... closures) Factory method that performs validation and copies the parameter array.voidExecute a list of closures.Gets the closures.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial version UID- See Also:
-
iClosures
-
-
Constructor Details
-
ChainedClosure
-
ChainedClosure
-
-
Method Details
-
chainedClosure
Factory method that performs validation and copies the parameter array.- Type Parameters:
E- the type that the closure acts on- Parameters:
closures- the closures to chain, copied, no nulls- Returns:
- the
chainedclosure - Throws:
NullPointerException- if the closures array is nullNullPointerException- if any closure in the array is null
-
chainedClosure
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.- Type Parameters:
E- the type that the closure acts on- Parameters:
closures- a collection of closures to chain- Returns:
- the
chainedclosure - Throws:
NullPointerException- if the closures collection is nullNullPointerException- if any closure in the collection is null
-
execute
-
getClosures
-