| Package | Description |
|---|---|
| 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.
|
| Modifier and Type | Method and Description |
|---|---|
static <T |
CollectionUtils.forAllButLastDo(Iterable
Deprecated.
since 4.1, use
IterableUtils instead
|
static <T |
CollectionUtils.forAllButLastDo(Iterator
Deprecated.
since 4.1, use
IteratorUtils instead
|
static <T |
CollectionUtils.forAllDo(Iterable
Deprecated.
since 4.1, use
IterableUtils instead
|
static <T |
CollectionUtils.forAllDo(Iterator
Deprecated.
since 4.1, use
IteratorUtils instead
|
| Modifier and Type | Method and Description |
|---|---|
static <E> Closure |
ClosureUtils.asClosure(Transformer
Creates a Closure that calls a Transformer each time it is called.
|
static <E> Closure |
ClosureUtils.chainedClosure(Closure
Create a new Closure that calls each closure in turn, passing the result into the next closure.
|
static <E> Closure |
ClosureUtils.chainedClosure(Collection
Create a new Closure that calls each closure in turn, passing the result into the next closure.
|
static <E> Closure |
ClosureUtils.doWhileClosure(Closure
Creates a Closure that will call the closure once and then repeatedly until the predicate returns false.
|
static <E> Closure |
ClosureUtils.exceptionClosure()
Gets a Closure that always throws an exception.
|
static <E> Closure |
ClosureUtils.forClosure(int count, Closure
Creates a Closure that will call the closure
count times.
|
static <E> Closure |
ClosureUtils.ifClosure(Predicate
Create a new Closure that calls another closure based on the result of the specified predicate.
|
static <E> Closure |
ClosureUtils.ifClosure(Predicate
Create a new Closure that calls one of two closures depending on the specified predicate.
|
static <E> Closure |
ClosureUtils.invokerClosure(String
Creates a Closure that will invoke a specific method on the closure's input object by reflection.
|
static <E> Closure |
ClosureUtils.invokerClosure(String
Creates a Closure that will invoke a specific method on the closure's input object by reflection.
|
static <E> Closure |
ClosureUtils.nopClosure()
Gets a Closure that will do nothing.
|
static <E> Closure |
ClosureUtils.switchClosure(Map
Create a new Closure that calls one of the closures depending on the predicates.
|
static <E> Closure |
ClosureUtils.switchClosure(Predicate
Create a new Closure that calls one of the closures depending on the predicates.
|
static <E> Closure |
ClosureUtils.switchClosure(Predicate
Create a new Closure that calls one of the closures depending on the predicates.
|
static <E> Closure |
ClosureUtils.switchMapClosure(Map
Create a new Closure that uses the input object as a key to find the closure to call.
|
static <E> Closure |
ClosureUtils.whileClosure(Predicate
Creates a Closure that will call the closure repeatedly until the predicate returns false.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> Transformer |
TransformerUtils.asTransformer(Closure
Creates a Transformer that calls a Closure each time the transformer is used.
|
static <E> Closure |
ClosureUtils.chainedClosure(Closure
Create a new Closure that calls each closure in turn, passing the result into the next closure.
|
static <E> Closure |
ClosureUtils.doWhileClosure(Closure
Creates a Closure that will call the closure once and then repeatedly until the predicate returns false.
|
static <E> Closure |
ClosureUtils.forClosure(int count, Closure
Creates a Closure that will call the closure
count times.
|
void |
FluentIterable.forEach(Closure
Applies the closure to all elements contained in this iterable.
|
static <E> void |
IterableUtils.forEach(Iterable
Applies the closure to each element of the provided iterable.
|
static <E> void |
IteratorUtils.forEach(Iterator
Applies the closure to each element of the provided iterator.
|
static <E> E |
IterableUtils.forEachButLast(Iterable
Executes the given closure on each but the last element in the iterable.
|
static <E> E |
IteratorUtils.forEachButLast(Iterator
Executes the given closure on each but the last element in the iterator.
|
static <E> Closure |
ClosureUtils.ifClosure(Predicate
Create a new Closure that calls another closure based on the result of the specified predicate.
|
static <E> Closure |
ClosureUtils.ifClosure(Predicate
Create a new Closure that calls one of two closures depending on the specified predicate.
|
static <E> Closure |
ClosureUtils.ifClosure(Predicate
Create a new Closure that calls one of two closures depending on the specified predicate.
|
static <E> Closure |
ClosureUtils.switchClosure(Predicate
Create a new Closure that calls one of the closures depending on the predicates.
|
static <E> Closure |
ClosureUtils.switchClosure(Predicate
Create a new Closure that calls one of the closures depending on the predicates.
|
static <E> Closure |
ClosureUtils.switchClosure(Predicate
Create a new Closure that calls one of the closures depending on the predicates.
|
static <E> Closure |
ClosureUtils.whileClosure(Predicate
Creates a Closure that will call the closure repeatedly until the predicate returns false.
|
| Modifier and Type | Method and Description |
|---|---|
static <E> Closure |
ClosureUtils.chainedClosure(Collection
Create a new Closure that calls each closure in turn, passing the result into the next closure.
|
static <E> Closure |
ClosureUtils.switchClosure(Map
Create a new Closure that calls one of the closures depending on the predicates.
|
static <E> Closure |
ClosureUtils.switchMapClosure(Map
Create a new Closure that uses the input object as a key to find the closure to call.
|
| Modifier and Type | Class and Description |
|---|---|
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.
|
| Modifier and Type | Field and Description |
|---|---|
static Closure |
NOPClosure.INSTANCE
Singleton predicate instance
|
static Closure |
ExceptionClosure.INSTANCE
Singleton predicate instance
|
| Modifier and Type | Method and Description |
|---|---|
static <E> Closure |
ChainedClosure.chainedClosure(Closure
Factory method that performs validation and copies the parameter array.
|
static <E> Closure |
ChainedClosure.chainedClosure(Collection
Create a new Closure that calls each closure in turn, passing the result into the next closure.
|
static <E> Closure |
ExceptionClosure.exceptionClosure()
Factory returning the singleton instance.
|
static <E> Closure |
ForClosure.forClosure(int count, Closure
Factory method that performs validation.
|
Closure |
WhileClosure.getClosure()
Gets the closure.
|
Closure |
ClosureTransformer.getClosure()
Gets the closure.
|
Closure |
ForClosure.getClosure()
Gets the closure.
|
Closure |
ChainedClosure.getClosures()
Gets the closures.
|
Closure |
SwitchClosure.getClosures()
Gets the closures.
|
Closure |
SwitchClosure.getDefaultClosure()
Gets the default closure.
|
Closure |
IfClosure.getFalseClosure()
Gets the closure called when false.
|
Closure |
IfClosure.getTrueClosure()
Gets the closure called when true.
|
static <E> Closure |
IfClosure.ifClosure(Predicate
Factory method that performs validation.
|
static <E> Closure |
IfClosure.ifClosure(Predicate
Factory method that performs validation.
|
static <E> Closure |
NOPClosure.nopClosure()
Factory returning the singleton instance.
|
static <E> Closure |
SwitchClosure.switchClosure(Map
Create a new Closure that calls one of the closures depending on the predicates.
|
static <E> Closure |
SwitchClosure.switchClosure(Predicate
Factory method that performs validation and copies the parameter arrays.
|
static <E> Closure |
TransformerClosure.transformerClosure(Transformer
Factory method that performs validation.
|
static <E> Closure |
WhileClosure.whileClosure(Predicate
Factory method that performs validation.
|
| Modifier and Type | Method and Description |
|---|---|
static <E> Closure |
ChainedClosure.chainedClosure(Closure
Factory method that performs validation and copies the parameter array.
|
static <T> Transformer |
ClosureTransformer.closureTransformer(Closure
Factory method that performs validation.
|
static <E> Closure |
ForClosure.forClosure(int count, Closure
Factory method that performs validation.
|
static <E> Closure |
IfClosure.ifClosure(Predicate
Factory method that performs validation.
|
static <E> Closure |
IfClosure.ifClosure(Predicate
Factory method that performs validation.
|
static <E> Closure |
IfClosure.ifClosure(Predicate
Factory method that performs validation.
|
static <E> Closure |
SwitchClosure.switchClosure(Predicate
Factory method that performs validation and copies the parameter arrays.
|
static <E> Closure |
SwitchClosure.switchClosure(Predicate
Factory method that performs validation and copies the parameter arrays.
|
static <E> Closure |
WhileClosure.whileClosure(Predicate
Factory method that performs validation.
|
| Modifier and Type | Method and Description |
|---|---|
static <E> Closure |
ChainedClosure.chainedClosure(Collection
Create a new Closure that calls each closure in turn, passing the result into the next closure.
|
static <E> Closure |
SwitchClosure.switchClosure(Map
Create a new Closure that calls one of the closures depending on the predicates.
|
| Constructor and Description | |
|---|---|
ChainedClosure(Closure
Constructor that performs no validation.
|
|
ClosureTransformer(Closure
Constructor that performs no validation.
|
|
ForClosure(int count, Closure
Constructor that performs no validation.
|
|
IfClosure(Predicate
Constructor that performs no validation.
|
|
IfClosure(Predicate
Constructor that performs no validation.
|
|
IfClosure(Predicate
Constructor that performs no validation.
|
|
SwitchClosure(Predicate
Constructor that performs no validation.
|
|
SwitchClosure(Predicate
Constructor that performs no validation.
|
|
WhileClosure(Predicate
Constructor that performs no validation.
|