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 boolean | iDoLoop
The flag, true is a do loop, false is a while |
| private final Predicate | iPredicate
The test condition |
| Access | Constructor and Description |
|---|---|
| public | WhileClosure(final Predicate<? super E>
the predicate used to evaluate when the loop terminates, not null predicate, final Closure<? super E> the closure the execute, not null closure, final boolean true to act as a do-while loop, always executing the closure once doLoop)Constructor that performs no validation. |
| Modifier and Type | Method and Description |
|---|---|
| public void | execute(final E
the input object input)Implements org. |
| public Closure | |
| public Predicate | |
| public boolean | |
| public static < the type that the closure acts on E> Closure | Returns: thewhile closurethe predicate used to evaluate when the loop terminates, not null predicate, final Closure<? super E> the closure the execute, not null closure, final boolean true to act as a do-while loop, always executing the closure once doLoop)Factory method that performs validation. |
| iClosure | back to summary |
|---|---|
| private final Closure<? super E> iClosure The closure to call | |
| iDoLoop | back to summary |
|---|---|
| private final boolean iDoLoop The flag, true is a do loop, false is a while | |
| iPredicate | back to summary |
|---|---|
| private final Predicate<? super E> iPredicate The test condition | |
| WhileClosure | back to summary |
|---|---|
| public WhileClosure(final Predicate<? super E> predicate, final Closure<? super E> closure, final boolean doLoop) Constructor that performs no validation.
Use | |
| execute | back to summary |
|---|---|
| public void execute(final E input) Implements org. Executes the closure until the predicate is false.
| |
| getClosure | back to summary |
|---|---|
| public Closure Gets the closure.
| |
| getPredicate | back to summary |
|---|---|
| public Predicate Gets the predicate in use.
| |
| isDoLoop | back to summary |
|---|---|
| public boolean isDoLoop() Is the loop a do-while loop.
| |
| whileClosure | back to summary |
|---|---|
| public static <E> Closure Factory method that performs validation.
| |