| java.lang.Object org.apache.commons.collections.functors.WhileClosure
WhileClosure | public class WhileClosure implements Closure,Serializable(Code) | | Closure implementation that executes a closure repeatedly until a condition is met,
like a do-while or while loop.
since: Commons Collections 3.0 version: $Revision: 348444 $ $Date: 2005-11-23 14:06:56 +0000 (Wed, 23 Nov 2005) $ author: Stephen Colebourne |
WhileClosure | public WhileClosure(Predicate predicate, Closure closure, boolean doLoop)(Code) | | Constructor that performs no validation.
Use getInstance if you want that.
Parameters: predicate - the predicate used to evaluate when the loop terminates, not null Parameters: closure - the closure the execute, not null Parameters: doLoop - true to act as a do-while loop, always executing the closure once |
execute | public void execute(Object input)(Code) | | Executes the closure until the predicate is false.
Parameters: input - the input object |
getClosure | public Closure getClosure()(Code) | | Gets the closure.
the closure since: Commons Collections 3.1 |
getInstance | public static Closure getInstance(Predicate predicate, Closure closure, boolean doLoop)(Code) | | Factory method that performs validation.
Parameters: predicate - the predicate used to evaluate when the loop terminates, not null Parameters: closure - the closure the execute, not null Parameters: doLoop - true to act as a do-while loop, always executing the closure once the while closure throws: IllegalArgumentException - if the predicate or closure is null |
getPredicate | public Predicate getPredicate()(Code) | | Gets the predicate in use.
the predicate since: Commons Collections 3.1 |
isDoLoop | public boolean isDoLoop()(Code) | | Is the loop a do-while loop.
true is do-while, false if while since: Commons Collections 3.1 |
|
|