## Uses of Interface
org.apache.commons.collections.Closure

Packages that use Closure
org.apache.commons.collections: This package contains the interfaces and utilities shared across all the subpackages of this component.
org.apache.commons.collections.functors: This package contains implementations of the `Closure`, `Predicate`, `Transformer` and `Factory` interfaces.

Uses of Closure in org.apache.commons.collections

Methods in org.apache.commons.collections that return Closure
`static Closure` `ClosureUtils.exceptionClosure()` Gets a Closure that always throws an exception.
`static Closure` `ClosureUtils.nopClosure()` Gets a Closure that will do nothing.
`static Closure` `ClosureUtils.asClosure(Transformer transformer)` Creates a Closure that calls a Transformer each time it is called.
`static Closure` `ClosureUtils.forClosure(int count, Closure closure)` Creates a Closure that will call the closure `count` times.
`static Closure` `ClosureUtils.whileClosure(Predicate predicate, Closure closure)` Creates a Closure that will call the closure repeatedly until the predicate returns false.
`static Closure` `ClosureUtils.doWhileClosure(Closure closure, Predicate predicate)` Creates a Closure that will call the closure once and then repeatedly until the predicate returns false.
`static Closure` `ClosureUtils.invokerClosure(String methodName)` Creates a Closure that will invoke a specific method on the closure's input object by reflection.
`static Closure` `ClosureUtils.invokerClosure(String methodName, Class[] paramTypes, Object[] args)` Creates a Closure that will invoke a specific method on the closure's input object by reflection.
`static Closure` `ClosureUtils.chainedClosure(Closure closure1, Closure closure2)` Create a new Closure that calls two Closures, passing the result of the first into the second.
`static Closure` `ClosureUtils.chainedClosure(Closure[] closures)` Create a new Closure that calls each closure in turn, passing the result into the next closure.
`static Closure` `ClosureUtils.chainedClosure(Collection closures)` Create a new Closure that calls each closure in turn, passing the result into the next closure.
`static Closure` `ClosureUtils.ifClosure(Predicate predicate, Closure trueClosure, Closure falseClosure)` Create a new Closure that calls one of two closures depending on the specified predicate.
`static Closure` `ClosureUtils.switchClosure(Predicate[] predicates, Closure[] closures)` Create a new Closure that calls one of the closures depending on the predicates.
`static Closure` `ClosureUtils.switchClosure(Predicate[] predicates, Closure[] closures, Closure defaultClosure)` Create a new Closure that calls one of the closures depending on the predicates.
`static Closure` `ClosureUtils.switchClosure(Map predicatesAndClosures)` Create a new Closure that calls one of the closures depending on the predicates.
`static Closure` `ClosureUtils.switchMapClosure(Map objectsAndClosures)` Create a new Closure that uses the input object as a key to find the closure to call.

Methods in org.apache.commons.collections with parameters of type Closure
`static Transformer` `TransformerUtils.asTransformer(Closure closure)` Creates a Transformer that calls a Closure each time the transformer is used.
`static void` `CollectionUtils.forAllDo(Collection collection, Closure closure)` Executes the given closure on each element in the collection.
`static Closure` `ClosureUtils.forClosure(int count, Closure closure)` Creates a Closure that will call the closure `count` times.
`static Closure` `ClosureUtils.whileClosure(Predicate predicate, Closure closure)` Creates a Closure that will call the closure repeatedly until the predicate returns false.
`static Closure` `ClosureUtils.doWhileClosure(Closure closure, Predicate predicate)` Creates a Closure that will call the closure once and then repeatedly until the predicate returns false.
`static Closure` `ClosureUtils.chainedClosure(Closure closure1, Closure closure2)` Create a new Closure that calls two Closures, passing the result of the first into the second.
`static Closure` `ClosureUtils.chainedClosure(Closure[] closures)` Create a new Closure that calls each closure in turn, passing the result into the next closure.
`static Closure` `ClosureUtils.ifClosure(Predicate predicate, Closure trueClosure, Closure falseClosure)` Create a new Closure that calls one of two closures depending on the specified predicate.
`static Closure` `ClosureUtils.switchClosure(Predicate[] predicates, Closure[] closures)` Create a new Closure that calls one of the closures depending on the predicates.
`static Closure` `ClosureUtils.switchClosure(Predicate[] predicates, Closure[] closures, Closure defaultClosure)` Create a new Closure that calls one of the closures depending on the predicates.

Uses of Closure in org.apache.commons.collections.functors

Classes in org.apache.commons.collections.functors that implement Closure
`class` `ChainedClosure` Closure implementation that chains the specified closures together.
`class` `ExceptionClosure` Closure implementation that always throws an exception.
`class` `ForClosure` Closure implementation that calls another closure n times, like a for loop.
`class` `IfClosure` Closure implementation acts as an if statement calling one or other closure based on a predicate.
`class` `NOPClosure` Closure implementation that does nothing.
`class` `SwitchClosure` Closure implementation calls the closure whose predicate returns true, like a switch statement.
`class` `TransformerClosure` Closure implementation that calls a Transformer using the input object and ignore the result.
`class` `WhileClosure` Closure implementation that executes a closure repeatedly until a condition is met, like a do-while or while loop.

Fields in org.apache.commons.collections.functors declared as Closure
`static Closure` `ExceptionClosure.INSTANCE` Singleton predicate instance
`static Closure` `NOPClosure.INSTANCE` Singleton predicate instance

Methods in org.apache.commons.collections.functors that return Closure
`static Closure` `ForClosure.getInstance(int count, Closure closure)` Factory method that performs validation.
`Closure` `ForClosure.getClosure()` Gets the closure.
`Closure` `ClosureTransformer.getClosure()` Gets the closure.
`static Closure` `ChainedClosure.getInstance(Closure[] closures)` Factory method that performs validation and copies the parameter array.
`static Closure` `ChainedClosure.getInstance(Collection closures)` Create a new Closure that calls each closure in turn, passing the result into the next closure.
`static Closure` `ChainedClosure.getInstance(Closure closure1, Closure closure2)` Factory method that performs validation.
`Closure[]` `ChainedClosure.getClosures()` Gets the closures, do not modify the array.
`static Closure` `WhileClosure.getInstance(Predicate predicate, Closure closure, boolean doLoop)` Factory method that performs validation.
`Closure` `WhileClosure.getClosure()` Gets the closure.
`static Closure` `SwitchClosure.getInstance(Predicate[] predicates, Closure[] closures, Closure defaultClosure)` Factory method that performs validation and copies the parameter arrays.
`static Closure` `SwitchClosure.getInstance(Map predicatesAndClosures)` Create a new Closure that calls one of the closures depending on the predicates.
`Closure[]` `SwitchClosure.getClosures()` Gets the closures, do not modify the array.
`Closure` `SwitchClosure.getDefaultClosure()` Gets the default closure.
`static Closure` `IfClosure.getInstance(Predicate predicate, Closure trueClosure, Closure falseClosure)` Factory method that performs validation.
`Closure` `IfClosure.getTrueClosure()` Gets the closure called when true.
`Closure` `IfClosure.getFalseClosure()` Gets the closure called when false.
`static Closure` `ExceptionClosure.getInstance()` Factory returning the singleton instance.
`static Closure` `TransformerClosure.getInstance(Transformer transformer)` Factory method that performs validation.
`static Closure` `NOPClosure.getInstance()` Factory returning the singleton instance.

Methods in org.apache.commons.collections.functors with parameters of type Closure
`static Closure` `ForClosure.getInstance(int count, Closure closure)` Factory method that performs validation.
`static Transformer` `ClosureTransformer.getInstance(Closure closure)` Factory method that performs validation.
`static Closure` `ChainedClosure.getInstance(Closure[] closures)` Factory method that performs validation and copies the parameter array.
`static Closure` `ChainedClosure.getInstance(Closure closure1, Closure closure2)` Factory method that performs validation.
`static Closure` `WhileClosure.getInstance(Predicate predicate, Closure closure, boolean doLoop)` Factory method that performs validation.
`static Closure` `SwitchClosure.getInstance(Predicate[] predicates, Closure[] closures, Closure defaultClosure)` Factory method that performs validation and copies the parameter arrays.
`static Closure` `IfClosure.getInstance(Predicate predicate, Closure trueClosure, Closure falseClosure)` Factory method that performs validation.

Constructors in org.apache.commons.collections.functors with parameters of type Closure
`ForClosure(int count, Closure closure)` Constructor that performs no validation.
`ClosureTransformer(Closure closure)` Constructor that performs no validation.
`ChainedClosure(Closure[] closures)` Constructor that performs no validation.
`WhileClosure(Predicate predicate, Closure closure, boolean doLoop)` Constructor that performs no validation.
`SwitchClosure(Predicate[] predicates, Closure[] closures, Closure defaultClosure)` Constructor that performs no validation.
`IfClosure(Predicate predicate, Closure trueClosure, Closure falseClosure)` Constructor that performs no validation.

Copyright © 2001-2005 Apache Software Foundation. All Rights Reserved.