Warning
from v4.1 onwards this class will not be serializable anymore in order to prevent potential remote code execution exploits. Please refer to COLLECTIONS-580 for more details.
| Modifier and Type | Field and Description |
|---|---|
| private final Closure | iClosure
The closure to call |
| private final int | iCount
The number of times to loop |
| Access | Constructor and Description |
|---|---|
| public | ForClosure(final int
the number of times to execute the closure count, final Closure<? super E> the closure to execute, not null closure)Constructor that performs no validation. |
| Modifier and Type | Method and Description |
|---|---|
| public void | execute(final E
the input object input)Implements org. count times.
|
| public static < the type that the closure acts on E> Closure | Returns: thefor closurethe number of times to execute the closure count, final Closure<? super E> the closure to execute, not null closure)Factory method that performs validation. |
| public Closure | |
| public int |
| iClosure | back to summary |
|---|---|
| private final Closure<? super E> iClosure The closure to call | |
| iCount | back to summary |
|---|---|
| private final int iCount The number of times to loop | |
| ForClosure | back to summary |
|---|---|
| public ForClosure(final int count, final Closure<? super E> closure) Constructor that performs no validation.
Use
| |
| execute | back to summary |
|---|---|
| public void execute(final E input) Implements org. Executes the closure
| |
| forClosure | back to summary |
|---|---|
| public static <E> Closure Factory method that performs validation.
A null closure or zero count returns the
| |
| getClosure | back to summary |
|---|---|
| public Closure Gets the closure.
| |
| getCount | back to summary |
|---|---|
| public int getCount() Gets the count.
| |