|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
Packages that use Closure | |
---|---|
org.apache.commons.collections4 | This package contains the interfaces and utilities shared across all the subpackages of this component. |
org.apache.commons.collections4.functors | This package contains implementations of the
Closure ,
Predicate ,
Transformer and
Factory interfaces. |
Uses of Closure in org.apache.commons.collections4 |
---|
Methods in org.apache.commons.collections4 with type parameters of type Closure | ||
---|---|---|
static
|
CollectionUtils.forAllButLastDo(Iterable<T> collection,
C closure)
Executes the given closure on each but the last element in the collection. |
|
static
|
CollectionUtils.forAllButLastDo(Iterator<T> iterator,
C closure)
Executes the given closure on each but the last element in the collection. |
|
static
|
CollectionUtils.forAllDo(Iterable<T> collection,
C closure)
Executes the given closure on each element in the collection. |
|
static
|
CollectionUtils.forAllDo(Iterator<T> iterator,
C closure)
Executes the given closure on each element in the collection. |
Methods in org.apache.commons.collections4 that return Closure | ||
---|---|---|
static
|
ClosureUtils.asClosure(Transformer<? super E,?> transformer)
Creates a Closure that calls a Transformer each time it is called. |
|
static
|
ClosureUtils.chainedClosure(Closure<? super E>... closures)
Create a new Closure that calls each closure in turn, passing the result into the next closure. |
|
static
|
ClosureUtils.chainedClosure(Collection<Closure<E>> closures)
Create a new Closure that calls each closure in turn, passing the result into the next closure. |
|
static
|
ClosureUtils.doWhileClosure(Closure<? super E> closure,
Predicate<? super E> predicate)
Creates a Closure that will call the closure once and then repeatedly until the predicate returns false. |
|
static
|
ClosureUtils.exceptionClosure()
Gets a Closure that always throws an exception. |
|
static
|
ClosureUtils.forClosure(int count,
Closure<? super E> closure)
Creates a Closure that will call the closure count times. |
|
static
|
ClosureUtils.ifClosure(Predicate<? super E> predicate,
Closure<? super E> trueClosure)
Create a new Closure that calls another closure based on the result of the specified predicate. |
|
static
|
ClosureUtils.ifClosure(Predicate<? super E> predicate,
Closure<? super E> trueClosure,
Closure<? super E> falseClosure)
Create a new Closure that calls one of two closures depending on the specified predicate. |
|
static
|
ClosureUtils.invokerClosure(String methodName)
Creates a Closure that will invoke a specific method on the closure's input object by reflection. |
|
static
|
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
|
ClosureUtils.nopClosure()
Gets a Closure that will do nothing. |
|
static
|
ClosureUtils.switchClosure(Map<Predicate<E>,Closure<E>> predicatesAndClosures)
Create a new Closure that calls one of the closures depending on the predicates. |
|
static
|
ClosureUtils.switchClosure(Predicate<? super E>[] predicates,
Closure<? super E>[] closures)
Create a new Closure that calls one of the closures depending on the predicates. |
|
static
|
ClosureUtils.switchClosure(Predicate<? super E>[] predicates,
Closure<? super E>[] closures,
Closure<? super E> defaultClosure)
Create a new Closure that calls one of the closures depending on the predicates. |
|
static
|
ClosureUtils.switchMapClosure(Map<? extends E,Closure<E>> objectsAndClosures)
Create a new Closure that uses the input object as a key to find the closure to call. |
|
static
|
ClosureUtils.whileClosure(Predicate<? super E> predicate,
Closure<? super E> closure)
Creates a Closure that will call the closure repeatedly until the predicate returns false. |
Methods in org.apache.commons.collections4 with parameters of type Closure | ||
---|---|---|
static
|
TransformerUtils.asTransformer(Closure<? super T> closure)
Creates a Transformer that calls a Closure each time the transformer is used. |
|
static
|
ClosureUtils.chainedClosure(Closure<? super E>... closures)
Create a new Closure that calls each closure in turn, passing the result into the next closure. |
|
static
|
ClosureUtils.doWhileClosure(Closure<? super E> closure,
Predicate<? super E> predicate)
Creates a Closure that will call the closure once and then repeatedly until the predicate returns false. |
|
static
|
ClosureUtils.forClosure(int count,
Closure<? super E> closure)
Creates a Closure that will call the closure count times. |
|
static
|
ClosureUtils.ifClosure(Predicate<? super E> predicate,
Closure<? super E> trueClosure)
Create a new Closure that calls another closure based on the result of the specified predicate. |
|
static
|
ClosureUtils.ifClosure(Predicate<? super E> predicate,
Closure<? super E> trueClosure,
Closure<? super E> falseClosure)
Create a new Closure that calls one of two closures depending on the specified predicate. |
|
static
|
ClosureUtils.ifClosure(Predicate<? super E> predicate,
Closure<? super E> trueClosure,
Closure<? super E> falseClosure)
Create a new Closure that calls one of two closures depending on the specified predicate. |
|
static
|
ClosureUtils.switchClosure(Predicate<? super E>[] predicates,
Closure<? super E>[] closures)
Create a new Closure that calls one of the closures depending on the predicates. |
|
static
|
ClosureUtils.switchClosure(Predicate<? super E>[] predicates,
Closure<? super E>[] closures,
Closure<? super E> defaultClosure)
Create a new Closure that calls one of the closures depending on the predicates. |
|
static
|
ClosureUtils.switchClosure(Predicate<? super E>[] predicates,
Closure<? super E>[] closures,
Closure<? super E> defaultClosure)
Create a new Closure that calls one of the closures depending on the predicates. |
|
static
|
ClosureUtils.whileClosure(Predicate<? super E> predicate,
Closure<? super E> closure)
Creates a Closure that will call the closure repeatedly until the predicate returns false. |
Method parameters in org.apache.commons.collections4 with type arguments of type Closure | ||
---|---|---|
static
|
ClosureUtils.chainedClosure(Collection<Closure<E>> closures)
Create a new Closure that calls each closure in turn, passing the result into the next closure. |
|
static
|
ClosureUtils.switchClosure(Map<Predicate<E>,Closure<E>> predicatesAndClosures)
Create a new Closure that calls one of the closures depending on the predicates. |
|
static
|
ClosureUtils.switchMapClosure(Map<? extends E,Closure<E>> 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.collections4.functors |
---|
Classes in org.apache.commons.collections4.functors that implement Closure | |
---|---|
class |
CatchAndRethrowClosure<E>
Closure that catches any checked exception and re-throws it as a
FunctorException runtime exception. |
class |
ChainedClosure<E>
Closure implementation that chains the specified closures together. |
class |
ExceptionClosure<E>
Closure implementation that always throws an exception. |
class |
ForClosure<E>
Closure implementation that calls another closure n times, like a for loop. |
class |
IfClosure<E>
Closure implementation acts as an if statement calling one or other closure based on a predicate. |
class |
NOPClosure<E>
Closure implementation that does nothing. |
class |
SwitchClosure<E>
Closure implementation calls the closure whose predicate returns true, like a switch statement. |
class |
TransformerClosure<E>
Closure implementation that calls a Transformer using the input object and ignore the result. |
class |
WhileClosure<E>
Closure implementation that executes a closure repeatedly until a condition is met, like a do-while or while loop. |
Fields in org.apache.commons.collections4.functors declared as Closure | |
---|---|
static Closure<Object> |
NOPClosure.INSTANCE
Singleton predicate instance |
static Closure<Object> |
ExceptionClosure.INSTANCE
Singleton predicate instance |
Methods in org.apache.commons.collections4.functors that return Closure | ||
---|---|---|
static
|
ChainedClosure.chainedClosure(Closure<? super E>... closures)
Factory method that performs validation and copies the parameter array. |
|
static
|
ChainedClosure.chainedClosure(Collection<Closure<E>> closures)
Create a new Closure that calls each closure in turn, passing the result into the next closure. |
|
static
|
ExceptionClosure.exceptionClosure()
Factory returning the singleton instance. |
|
static
|
ForClosure.forClosure(int count,
Closure<? super E> closure)
Factory method that performs validation. |
|
Closure<? super E> |
WhileClosure.getClosure()
Gets the closure. |
|
Closure<? super T> |
ClosureTransformer.getClosure()
Gets the closure. |
|
Closure<? super E> |
ForClosure.getClosure()
Gets the closure. |
|
Closure<? super E>[] |
ChainedClosure.getClosures()
Gets the closures. |
|
Closure<? super E>[] |
SwitchClosure.getClosures()
Gets the closures. |
|
Closure<? super E> |
SwitchClosure.getDefaultClosure()
Gets the default closure. |
|
Closure<? super E> |
IfClosure.getFalseClosure()
Gets the closure called when false. |
|
Closure<? super E> |
IfClosure.getTrueClosure()
Gets the closure called when true. |
|
static
|
IfClosure.ifClosure(Predicate<? super E> predicate,
Closure<? super E> trueClosure)
Factory method that performs validation. |
|
static
|
IfClosure.ifClosure(Predicate<? super E> predicate,
Closure<? super E> trueClosure,
Closure<? super E> falseClosure)
Factory method that performs validation. |
|
static
|
NOPClosure.nopClosure()
Factory returning the singleton instance. |
|
static
|
SwitchClosure.switchClosure(Map<Predicate<E>,Closure<E>> predicatesAndClosures)
Create a new Closure that calls one of the closures depending on the predicates. |
|
static
|
SwitchClosure.switchClosure(Predicate<? super E>[] predicates,
Closure<? super E>[] closures,
Closure<? super E> defaultClosure)
Factory method that performs validation and copies the parameter arrays. |
|
static
|
TransformerClosure.transformerClosure(Transformer<? super E,?> transformer)
Factory method that performs validation. |
|
static
|
WhileClosure.whileClosure(Predicate<? super E> predicate,
Closure<? super E> closure,
boolean doLoop)
Factory method that performs validation. |
Methods in org.apache.commons.collections4.functors with parameters of type Closure | ||
---|---|---|
static
|
ChainedClosure.chainedClosure(Closure<? super E>... closures)
Factory method that performs validation and copies the parameter array. |
|
static
|
ClosureTransformer.closureTransformer(Closure<? super T> closure)
Factory method that performs validation. |
|
static
|
ForClosure.forClosure(int count,
Closure<? super E> closure)
Factory method that performs validation. |
|
static
|
IfClosure.ifClosure(Predicate<? super E> predicate,
Closure<? super E> trueClosure)
Factory method that performs validation. |
|
static
|
IfClosure.ifClosure(Predicate<? super E> predicate,
Closure<? super E> trueClosure,
Closure<? super E> falseClosure)
Factory method that performs validation. |
|
static
|
IfClosure.ifClosure(Predicate<? super E> predicate,
Closure<? super E> trueClosure,
Closure<? super E> falseClosure)
Factory method that performs validation. |
|
static
|
SwitchClosure.switchClosure(Predicate<? super E>[] predicates,
Closure<? super E>[] closures,
Closure<? super E> defaultClosure)
Factory method that performs validation and copies the parameter arrays. |
|
static
|
SwitchClosure.switchClosure(Predicate<? super E>[] predicates,
Closure<? super E>[] closures,
Closure<? super E> defaultClosure)
Factory method that performs validation and copies the parameter arrays. |
|
static
|
WhileClosure.whileClosure(Predicate<? super E> predicate,
Closure<? super E> closure,
boolean doLoop)
Factory method that performs validation. |
Method parameters in org.apache.commons.collections4.functors with type arguments of type Closure | ||
---|---|---|
static
|
ChainedClosure.chainedClosure(Collection<Closure<E>> closures)
Create a new Closure that calls each closure in turn, passing the result into the next closure. |
|
static
|
SwitchClosure.switchClosure(Map<Predicate<E>,Closure<E>> predicatesAndClosures)
Create a new Closure that calls one of the closures depending on the predicates. |
Constructors in org.apache.commons.collections4.functors with parameters of type Closure | |
---|---|
ChainedClosure(Closure<? super E>... closures)
Constructor that performs no validation. |
|
ClosureTransformer(Closure<? super T> closure)
Constructor that performs no validation. |
|
ForClosure(int count,
Closure<? super E> closure)
Constructor that performs no validation. |
|
IfClosure(Predicate<? super E> predicate,
Closure<? super E> trueClosure)
Constructor that performs no validation. |
|
IfClosure(Predicate<? super E> predicate,
Closure<? super E> trueClosure,
Closure<? super E> falseClosure)
Constructor that performs no validation. |
|
IfClosure(Predicate<? super E> predicate,
Closure<? super E> trueClosure,
Closure<? super E> falseClosure)
Constructor that performs no validation. |
|
SwitchClosure(Predicate<? super E>[] predicates,
Closure<? super E>[] closures,
Closure<? super E> defaultClosure)
Constructor that performs no validation. |
|
SwitchClosure(Predicate<? super E>[] predicates,
Closure<? super E>[] closures,
Closure<? super E> defaultClosure)
Constructor that performs no validation. |
|
WhileClosure(Predicate<? super E> predicate,
Closure<? super E> closure,
boolean doLoop)
Constructor that performs no validation. |
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |