Uses of Interface
org.apache.commons.collections.Closure
Packages that use Closure
Package
Description
This package contains the interfaces and utilities shared across all the subpackages of this component.
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 ClosureModifier and TypeMethodDescriptionstatic ClosureClosureUtils.asClosure(Transformer transformer) Creates a Closure that calls a Transformer each time it is called.static ClosureClosureUtils.chainedClosure(Collection closures) Create a new Closure that calls each closure in turn, passing the result into the next closure.static ClosureClosureUtils.chainedClosure(Closure[] closures) Create a new Closure that calls each closure in turn, passing the result into the next closure.static ClosureClosureUtils.chainedClosure(Closure closure1, Closure closure2) Create a new Closure that calls two Closures, passing the result of the first into the second.static ClosureClosureUtils.doWhileClosure(Closure closure, Predicate predicate) Creates a Closure that will call the closure once and then repeatedly until the predicate returns false.static ClosureClosureUtils.exceptionClosure()Gets a Closure that always throws an exception.static ClosureClosureUtils.forClosure(int count, Closure closure) Creates a Closure that will call the closurecounttimes.static ClosureCreate a new Closure that calls another closure based on the result of the specified predicate.static ClosureCreate a new Closure that calls one of two closures depending on the specified predicate.static ClosureClosureUtils.invokerClosure(String methodName) Creates a Closure that will invoke a specific method on the closure's input object by reflection.static ClosureClosureUtils.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 ClosureClosureUtils.nopClosure()Gets a Closure that will do nothing.static ClosureClosureUtils.switchClosure(Map predicatesAndClosures) Create a new Closure that calls one of the closures depending on the predicates.static ClosureClosureUtils.switchClosure(Predicate[] predicates, Closure[] closures) Create a new Closure that calls one of the closures depending on the predicates.static ClosureClosureUtils.switchClosure(Predicate[] predicates, Closure[] closures, Closure defaultClosure) Create a new Closure that calls one of the closures depending on the predicates.static ClosureClosureUtils.switchMapClosure(Map objectsAndClosures) Create a new Closure that uses the input object as a key to find the closure to call.static ClosureClosureUtils.whileClosure(Predicate predicate, Closure closure) Creates a Closure that will call the closure repeatedly until the predicate returns false.Methods in org.apache.commons.collections with parameters of type ClosureModifier and TypeMethodDescriptionstatic TransformerTransformerUtils.asTransformer(Closure closure) Creates a Transformer that calls a Closure each time the transformer is used.static ClosureClosureUtils.chainedClosure(Closure[] closures) Create a new Closure that calls each closure in turn, passing the result into the next closure.static ClosureClosureUtils.chainedClosure(Closure closure1, Closure closure2) Create a new Closure that calls two Closures, passing the result of the first into the second.static ClosureClosureUtils.doWhileClosure(Closure closure, Predicate predicate) Creates a Closure that will call the closure once and then repeatedly until the predicate returns false.static voidCollectionUtils.forAllDo(Collection collection, Closure closure) Executes the given closure on each element in the collection.static ClosureClosureUtils.forClosure(int count, Closure closure) Creates a Closure that will call the closurecounttimes.static ClosureCreate a new Closure that calls another closure based on the result of the specified predicate.static ClosureCreate a new Closure that calls one of two closures depending on the specified predicate.static ClosureClosureUtils.switchClosure(Predicate[] predicates, Closure[] closures) Create a new Closure that calls one of the closures depending on the predicates.static ClosureClosureUtils.switchClosure(Predicate[] predicates, Closure[] closures, Closure defaultClosure) Create a new Closure that calls one of the closures depending on the predicates.static ClosureClosureUtils.whileClosure(Predicate predicate, Closure closure) Creates a Closure that will call the closure repeatedly until the predicate returns false. -
Uses of Closure in org.apache.commons.collections.functors
Classes in org.apache.commons.collections.functors that implement ClosureModifier and TypeClassDescriptionclassClosure implementation that chains the specified closures together.final classClosure implementation that always throws an exception.classClosure implementation that calls another closure n times, like a for loop.classClosure implementation acts as an if statement calling one or other closure based on a predicate.classClosure implementation that does nothing.classClosure implementation calls the closure whose predicate returns true, like a switch statement.classClosure implementation that calls a Transformer using the input object and ignore the result.classClosure 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 ClosureModifier and TypeFieldDescriptionstatic final ClosureExceptionClosure.INSTANCESingleton predicate instancestatic final ClosureNOPClosure.INSTANCESingleton predicate instanceMethods in org.apache.commons.collections.functors that return ClosureModifier and TypeMethodDescriptionClosureTransformer.getClosure()Gets the closure.ForClosure.getClosure()Gets the closure.WhileClosure.getClosure()Gets the closure.Closure[]ChainedClosure.getClosures()Gets the closures, do not modify the array.Closure[]SwitchClosure.getClosures()Gets the closures, do not modify the array.SwitchClosure.getDefaultClosure()Gets the default closure.IfClosure.getFalseClosure()Gets the closure called when false.static ClosureChainedClosure.getInstance(Collection closures) Create a new Closure that calls each closure in turn, passing the result into the next closure.static ClosureChainedClosure.getInstance(Closure[] closures) Factory method that performs validation and copies the parameter array.static ClosureChainedClosure.getInstance(Closure closure1, Closure closure2) Factory method that performs validation.static ClosureExceptionClosure.getInstance()Factory returning the singleton instance.static ClosureForClosure.getInstance(int count, Closure closure) Factory method that performs validation.static ClosureIfClosure.getInstance(Predicate predicate, Closure trueClosure) Factory method that performs validation.static ClosureIfClosure.getInstance(Predicate predicate, Closure trueClosure, Closure falseClosure) Factory method that performs validation.static ClosureNOPClosure.getInstance()Factory returning the singleton instance.static ClosureSwitchClosure.getInstance(Map predicatesAndClosures) Create a new Closure that calls one of the closures depending on the predicates.static ClosureSwitchClosure.getInstance(Predicate[] predicates, Closure[] closures, Closure defaultClosure) Factory method that performs validation and copies the parameter arrays.static ClosureTransformerClosure.getInstance(Transformer transformer) Factory method that performs validation.static ClosureWhileClosure.getInstance(Predicate predicate, Closure closure, boolean doLoop) Factory method that performs validation.IfClosure.getTrueClosure()Gets the closure called when true.Methods in org.apache.commons.collections.functors with parameters of type ClosureModifier and TypeMethodDescriptionstatic ClosureChainedClosure.getInstance(Closure[] closures) Factory method that performs validation and copies the parameter array.static ClosureChainedClosure.getInstance(Closure closure1, Closure closure2) Factory method that performs validation.static TransformerClosureTransformer.getInstance(Closure closure) Factory method that performs validation.static ClosureForClosure.getInstance(int count, Closure closure) Factory method that performs validation.static ClosureIfClosure.getInstance(Predicate predicate, Closure trueClosure) Factory method that performs validation.static ClosureIfClosure.getInstance(Predicate predicate, Closure trueClosure, Closure falseClosure) Factory method that performs validation.static ClosureSwitchClosure.getInstance(Predicate[] predicates, Closure[] closures, Closure defaultClosure) Factory method that performs validation and copies the parameter arrays.static ClosureWhileClosure.getInstance(Predicate predicate, Closure closure, boolean doLoop) Factory method that performs validation.Constructors in org.apache.commons.collections.functors with parameters of type ClosureModifierConstructorDescriptionChainedClosure(Closure[] closures) Constructor that performs no validation.ClosureTransformer(Closure closure) Constructor that performs no validation.ForClosure(int count, Closure closure) Constructor that performs no validation.Constructor that performs no validation.Constructor that performs no validation.SwitchClosure(Predicate[] predicates, Closure[] closures, Closure defaultClosure) Constructor that performs no validation.WhileClosure(Predicate predicate, Closure closure, boolean doLoop) Constructor that performs no validation.