Uses of Interface
org.apache.commons.collections.Closure
-
Packages that use Closure Package Description 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 theClosure,Predicate,TransformerandFactoryinterfaces. -
-
Uses of Closure in org.apache.commons.collections
Methods in org.apache.commons.collections that return Closure Modifier and Type Method Description static ClosureClosureUtils. asClosure(Transformer transformer)Creates a Closure that calls a Transformer each time it is called.static ClosureClosureUtils. chainedClosure(java.util.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 ClosureClosureUtils. ifClosure(Predicate predicate, Closure trueClosure)Create a new Closure that calls another closure based on the result of the specified predicate.static ClosureClosureUtils. ifClosure(Predicate predicate, Closure trueClosure, Closure falseClosure)Create a new Closure that calls one of two closures depending on the specified predicate.static ClosureClosureUtils. invokerClosure(java.lang.String methodName)Creates a Closure that will invoke a specific method on the closure's input object by reflection.static ClosureClosureUtils. invokerClosure(java.lang.String methodName, java.lang.Class[] paramTypes, java.lang.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(java.util.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(java.util.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 Closure Modifier and Type Method Description static 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(java.util.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 ClosureClosureUtils. ifClosure(Predicate predicate, Closure trueClosure)Create a new Closure that calls another closure based on the result of the specified predicate.static ClosureClosureUtils. ifClosure(Predicate predicate, Closure trueClosure, Closure falseClosure)Create 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 Closure Modifier and Type Class Description classChainedClosureClosure implementation that chains the specified closures together.classExceptionClosureClosure implementation that always throws an exception.classForClosureClosure implementation that calls another closure n times, like a for loop.classIfClosureClosure implementation acts as an if statement calling one or other closure based on a predicate.classNOPClosureClosure implementation that does nothing.classSwitchClosureClosure implementation calls the closure whose predicate returns true, like a switch statement.classTransformerClosureClosure implementation that calls a Transformer using the input object and ignore the result.classWhileClosureClosure 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 Modifier and Type Field Description private ClosureClosureTransformer. iClosureThe closure to wrapprivate ClosureForClosure. iClosureThe closure to callprivate ClosureWhileClosure. iClosureThe closure to callprivate Closure[]ChainedClosure. iClosuresThe closures to call in turnprivate Closure[]SwitchClosure. iClosuresThe matching closures to callprivate ClosureSwitchClosure. iDefaultThe default closure to call if no tests matchprivate ClosureIfClosure. iFalseClosureThe closure to use if falsestatic ClosureExceptionClosure. INSTANCESingleton predicate instancestatic ClosureNOPClosure. INSTANCESingleton predicate instanceprivate ClosureIfClosure. iTrueClosureThe closure to use if trueMethods in org.apache.commons.collections.functors that return Closure Modifier and Type Method Description (package private) static Closure[]FunctorUtils. copy(Closure[] closures)Clone the closures to ensure that the internal reference can't be messed with.ClosureClosureTransformer. getClosure()Gets the closure.ClosureForClosure. getClosure()Gets the closure.ClosureWhileClosure. 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.ClosureSwitchClosure. getDefaultClosure()Gets the default closure.ClosureIfClosure. getFalseClosure()Gets the closure called when false.static ClosureChainedClosure. getInstance(java.util.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(java.util.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.ClosureIfClosure. getTrueClosure()Gets the closure called when true.Methods in org.apache.commons.collections.functors with parameters of type Closure Modifier and Type Method Description (package private) static Closure[]FunctorUtils. copy(Closure[] closures)Clone the closures to ensure that the internal reference can't be messed with.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 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.(package private) static voidFunctorUtils. validate(Closure[] closures)Validate the closures to ensure that all is well.Constructors in org.apache.commons.collections.functors with parameters of type Closure Constructor Description ChainedClosure(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.IfClosure(Predicate predicate, Closure trueClosure)Constructor that performs no validation.IfClosure(Predicate predicate, Closure trueClosure, Closure falseClosure)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.
-