|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
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
|
ClosureUtils.asClosure(Transformer<I,O> transformer)
Creates a Closure that calls a Transformer each time it is called. |
|
static
|
ClosureUtils.chainedClosure(Closure<T>[] closures)
Create a new Closure that calls each closure in turn, passing the result into the next closure. |
|
static
|
ClosureUtils.chainedClosure(Closure<T> closure1,
Closure<T> closure2)
Create a new Closure that calls two Closures, passing the result of the first into the second. |
|
static
|
ClosureUtils.chainedClosure(Collection<T> closures)
Create a new Closure that calls each closure in turn, passing the result into the next closure. |
|
static
|
ClosureUtils.doWhileClosure(Closure<? super T> closure,
Predicate<? super T> predicate)
Creates a Closure that will call the closure once and then repeatedly until the predicate returns false. |
|
static Closure |
ClosureUtils.exceptionClosure()
Gets a Closure that always throws an exception. |
|
static
|
ClosureUtils.forClosure(int count,
Closure<T> closure)
Creates a Closure that will call the closure count times. |
|
static
|
ClosureUtils.ifClosure(Predicate<? super T> predicate,
Closure<? super T> trueClosure,
Closure<? super T> falseClosure)
Create a new Closure that calls one of two closures depending on the specified predicate. |
|
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.nopClosure()
Gets a Closure that will do nothing. |
|
static
|
ClosureUtils.switchClosure(Map<Predicate<? super T>,Closure<? super T>> predicatesAndClosures)
Create a new Closure that calls one of the closures depending on the predicates. |
|
static
|
ClosureUtils.switchClosure(Predicate<? super T>[] predicates,
Closure<? super T>[] closures)
Create a new Closure that calls one of the closures depending on the predicates. |
|
static
|
ClosureUtils.switchClosure(Predicate<? super T>[] predicates,
Closure<? super T>[] closures,
Closure<? super T> defaultClosure)
Create a new Closure that calls one of the closures depending on the predicates. |
|
static
|
ClosureUtils.switchMapClosure(Map<T,Closure<T>> objectsAndClosures)
Create a new Closure that uses the input object as a key to find the closure to call. |
|
static
|
ClosureUtils.whileClosure(Predicate<? super T> predicate,
Closure<? super T> 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 | ||
---|---|---|
static
|
TransformerUtils.asTransformer(Closure<T> closure)
Creates a Transformer that calls a Closure each time the transformer is used. |
|
static
|
ClosureUtils.chainedClosure(Closure<T>[] closures)
Create a new Closure that calls each closure in turn, passing the result into the next closure. |
|
static
|
ClosureUtils.chainedClosure(Closure<T> closure1,
Closure<T> closure2)
Create a new Closure that calls two Closures, passing the result of the first into the second. |
|
static
|
ClosureUtils.chainedClosure(Closure<T> closure1,
Closure<T> closure2)
Create a new Closure that calls two Closures, passing the result of the first into the second. |
|
static
|
ClosureUtils.doWhileClosure(Closure<? super T> closure,
Predicate<? super T> predicate)
Creates a Closure that will call the closure once and then repeatedly until the predicate returns false. |
|
static
|
CollectionUtils.forAllDo(Collection<E> collection,
Closure<E> closure)
Executes the given closure on each element in the collection. |
|
static
|
ClosureUtils.forClosure(int count,
Closure<T> closure)
Creates a Closure that will call the closure count times. |
|
static
|
ClosureUtils.ifClosure(Predicate<? super T> predicate,
Closure<? super T> trueClosure,
Closure<? super T> falseClosure)
Create a new Closure that calls one of two closures depending on the specified predicate. |
|
static
|
ClosureUtils.ifClosure(Predicate<? super T> predicate,
Closure<? super T> trueClosure,
Closure<? super T> falseClosure)
Create a new Closure that calls one of two closures depending on the specified predicate. |
|
static
|
ClosureUtils.switchClosure(Predicate<? super T>[] predicates,
Closure<? super T>[] closures)
Create a new Closure that calls one of the closures depending on the predicates. |
|
static
|
ClosureUtils.switchClosure(Predicate<? super T>[] predicates,
Closure<? super T>[] closures,
Closure<? super T> defaultClosure)
Create a new Closure that calls one of the closures depending on the predicates. |
|
static
|
ClosureUtils.switchClosure(Predicate<? super T>[] predicates,
Closure<? super T>[] closures,
Closure<? super T> defaultClosure)
Create a new Closure that calls one of the closures depending on the predicates. |
|
static
|
ClosureUtils.whileClosure(Predicate<? super T> predicate,
Closure<? super T> closure)
Creates a Closure that will call the closure repeatedly until the predicate returns false. |
Method parameters in org.apache.commons.collections with type arguments of type Closure | ||
---|---|---|
static
|
ClosureUtils.switchClosure(Map<Predicate<? super T>,Closure<? super T>> predicatesAndClosures)
Create a new Closure that calls one of the closures depending on the predicates. |
|
static
|
ClosureUtils.switchMapClosure(Map<T,Closure<T>> objectsAndClosures)
Create a new Closure that uses the input object as a key to find the closure to call. |
Uses of Closure in org.apache.commons.collections.functors |
---|
Classes in org.apache.commons.collections.functors that implement Closure | |
---|---|
class |
ChainedClosure<T>
Closure implementation that chains the specified closures together. |
class |
ExceptionClosure<T>
Closure implementation that always throws an exception. |
class |
ForClosure<T>
Closure implementation that calls another closure n times, like a for loop. |
class |
IfClosure<T>
Closure implementation acts as an if statement calling one or other closure based on a predicate. |
class |
NOPClosure<T>
Closure implementation that does nothing. |
class |
SwitchClosure<T>
Closure implementation calls the closure whose predicate returns true, like a switch statement. |
class |
TransformerClosure<I,O>
Closure implementation that calls a Transformer using the input object and ignore the result. |
class |
WhileClosure<T>
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 |
NOPClosure.INSTANCE
Singleton predicate instance |
static Closure |
ExceptionClosure.INSTANCE
Singleton predicate instance |
Methods in org.apache.commons.collections.functors that return Closure | ||
---|---|---|
Closure<? super T> |
WhileClosure.getClosure()
Gets the closure. |
|
Closure<T> |
ForClosure.getClosure()
Gets the closure. |
|
Closure<T> |
ClosureTransformer.getClosure()
Gets the closure. |
|
Closure<? super T>[] |
SwitchClosure.getClosures()
Gets the closures, do not modify the array. |
|
Closure<? super T>[] |
ChainedClosure.getClosures()
Gets the closures, do not modify the array. |
|
Closure<? super T> |
SwitchClosure.getDefaultClosure()
Gets the default closure. |
|
Closure<? super T> |
IfClosure.getFalseClosure()
Gets the closure called when false. |
|
static Closure |
NOPClosure.getInstance()
Factory returning the singleton instance. |
|
static Closure |
ExceptionClosure.getInstance()
Factory returning the singleton instance. |
|
static
|
ChainedClosure.getInstance(Closure<? super T>[] closures)
Factory method that performs validation and copies the parameter array. |
|
static
|
ChainedClosure.getInstance(Closure<? super T> closure1,
Closure<? super T> closure2)
Factory method that performs validation. |
|
static
|
ChainedClosure.getInstance(Collection<? super T> closures)
Create a new Closure that calls each closure in turn, passing the result into the next closure. |
|
static
|
ForClosure.getInstance(int count,
Closure<T> closure)
Factory method that performs validation. |
|
static
|
SwitchClosure.getInstance(Map<Predicate<? super T>,Closure<? super T>> predicatesAndClosures)
Create a new Closure that calls one of the closures depending on the predicates. |
|
static
|
SwitchClosure.getInstance(Predicate<? super T>[] predicates,
Closure<? super T>[] closures,
Closure<? super T> defaultClosure)
Factory method that performs validation and copies the parameter arrays. |
|
static
|
WhileClosure.getInstance(Predicate<? super T> predicate,
Closure<? super T> closure,
boolean doLoop)
Factory method that performs validation. |
|
static
|
IfClosure.getInstance(Predicate<? super T> predicate,
Closure<? super T> trueClosure,
Closure<? super T> falseClosure)
Factory method that performs validation. |
|
static
|
TransformerClosure.getInstance(Transformer<? super I,O> transformer)
Factory method that performs validation. |
|
Closure<? super T> |
IfClosure.getTrueClosure()
Gets the closure called when true. |
Methods in org.apache.commons.collections.functors with parameters of type Closure | ||
---|---|---|
static
|
ChainedClosure.getInstance(Closure<? super T>[] closures)
Factory method that performs validation and copies the parameter array. |
|
static
|
ChainedClosure.getInstance(Closure<? super T> closure1,
Closure<? super T> closure2)
Factory method that performs validation. |
|
static
|
ChainedClosure.getInstance(Closure<? super T> closure1,
Closure<? super T> closure2)
Factory method that performs validation. |
|
static
|
ClosureTransformer.getInstance(Closure<T> closure)
Factory method that performs validation. |
|
static
|
ForClosure.getInstance(int count,
Closure<T> closure)
Factory method that performs validation. |
|
static
|
SwitchClosure.getInstance(Predicate<? super T>[] predicates,
Closure<? super T>[] closures,
Closure<? super T> defaultClosure)
Factory method that performs validation and copies the parameter arrays. |
|
static
|
SwitchClosure.getInstance(Predicate<? super T>[] predicates,
Closure<? super T>[] closures,
Closure<? super T> defaultClosure)
Factory method that performs validation and copies the parameter arrays. |
|
static
|
WhileClosure.getInstance(Predicate<? super T> predicate,
Closure<? super T> closure,
boolean doLoop)
Factory method that performs validation. |
|
static
|
IfClosure.getInstance(Predicate<? super T> predicate,
Closure<? super T> trueClosure,
Closure<? super T> falseClosure)
Factory method that performs validation. |
|
static
|
IfClosure.getInstance(Predicate<? super T> predicate,
Closure<? super T> trueClosure,
Closure<? super T> falseClosure)
Factory method that performs validation. |
Method parameters in org.apache.commons.collections.functors with type arguments of type Closure | ||
---|---|---|
static
|
SwitchClosure.getInstance(Map<Predicate<? super T>,Closure<? super T>> predicatesAndClosures)
Create a new Closure that calls one of the closures depending on the predicates. |
Constructors in org.apache.commons.collections.functors with parameters of type Closure | |
---|---|
ChainedClosure(Closure<? super T>[] closures)
Constructor that performs no validation. |
|
ClosureTransformer(Closure<T> closure)
Constructor that performs no validation. |
|
ForClosure(int count,
Closure<T> closure)
Constructor that performs no validation. |
|
IfClosure(Predicate<? super T> predicate,
Closure<? super T> trueClosure,
Closure<? super T> falseClosure)
Constructor that performs no validation. |
|
IfClosure(Predicate<? super T> predicate,
Closure<? super T> trueClosure,
Closure<? super T> falseClosure)
Constructor that performs no validation. |
|
SwitchClosure(Predicate<? super T>[] predicates,
Closure<? super T>[] closures,
Closure<? super T> defaultClosure)
Constructor that performs no validation. |
|
SwitchClosure(Predicate<? super T>[] predicates,
Closure<? super T>[] closures,
Closure<? super T> defaultClosure)
Constructor that performs no validation. |
|
WhileClosure(Predicate<? super T> predicate,
Closure<? super T> closure,
boolean doLoop)
Constructor that performs no validation. |
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |