/** * Factory method that performs validation. * * @param predicate the predicate used to evaluate when the loop terminates, not null * @param closure the closure the execute, not null * @param doLoop true to act as a do-while loop, always executing the closure once * @return the <code>while</code> closure * @throws IllegalArgumentException if the predicate or closure is null */ public static Closure getInstance(Predicate predicate, Closure closure, boolean doLoop) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } if (closure == null) { throw new IllegalArgumentException("Closure must not be null"); } return new WhileClosure(predicate, closure, doLoop); }
/** * Creates a Closure that will call the closure repeatedly until the * predicate returns false. * * @see org.apache.commons.collections.functors.WhileClosure * * @param predicate the predicate to use as an end of loop test, not null * @param closure the closure to call repeatedly, not null * @return the <code>while</code> closure * @throws IllegalArgumentException if either argument is null */ public static Closure whileClosure(Predicate predicate, Closure closure) { return WhileClosure.getInstance(predicate, closure, false); }
/** * Creates a Closure that will call the closure once and then repeatedly * until the predicate returns false. * * @see org.apache.commons.collections.functors.WhileClosure * * @param closure the closure to call repeatedly, not null * @param predicate the predicate to use as an end of loop test, not null * @return the <code>do-while</code> closure * @throws IllegalArgumentException if either argument is null */ public static Closure doWhileClosure(Closure closure, Predicate predicate) { return WhileClosure.getInstance(predicate, closure, true); }
/** * Factory method that performs validation. * * @param predicate the predicate used to evaluate when the loop terminates, not null * @param closure the closure the execute, not null * @param doLoop true to act as a do-while loop, always executing the closure once * @return the <code>while</code> closure * @throws IllegalArgumentException if the predicate or closure is null */ public static Closure getInstance(Predicate predicate, Closure closure, boolean doLoop) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } if (closure == null) { throw new IllegalArgumentException("Closure must not be null"); } return new WhileClosure(predicate, closure, doLoop); }
/** * Creates a Closure that will call the closure once and then repeatedly * until the predicate returns false. * * @see org.apache.commons.collections.functors.WhileClosure * * @param closure the closure to call repeatedly, not null * @param predicate the predicate to use as an end of loop test, not null * @return the <code>do-while</code> closure * @throws IllegalArgumentException if either argument is null */ public static Closure doWhileClosure(Closure closure, Predicate predicate) { return WhileClosure.getInstance(predicate, closure, true); }
public Object makeObject() { return new WhileClosure(FalsePredicate.INSTANCE, NOPClosure.INSTANCE, true); }
/** * Creates a Closure that will call the closure repeatedly until the * predicate returns false. * * @see org.apache.commons.collections.functors.WhileClosure * * @param predicate the predicate to use as an end of loop test, not null * @param closure the closure to call repeatedly, not null * @return the <code>while</code> closure * @throws IllegalArgumentException if either argument is null */ public static Closure whileClosure(Predicate predicate, Closure closure) { return WhileClosure.getInstance(predicate, closure, false); }
/** * Factory method that performs validation. * * @param predicate the predicate used to evaluate when the loop terminates, not null * @param closure the closure the execute, not null * @param doLoop true to act as a do-while loop, always executing the closure once * @return the <code>while</code> closure * @throws IllegalArgumentException if the predicate or closure is null */ public static Closure getInstance(Predicate predicate, Closure closure, boolean doLoop) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } if (closure == null) { throw new IllegalArgumentException("Closure must not be null"); } return new WhileClosure(predicate, closure, doLoop); }
/** * Creates a Closure that will call the closure once and then repeatedly * until the predicate returns false. * * @see org.apache.commons.collections.functors.WhileClosure * * @param closure the closure to call repeatedly, not null * @param predicate the predicate to use as an end of loop test, not null * @return the <code>do-while</code> closure * @throws IllegalArgumentException if either argument is null */ public static Closure doWhileClosure(Closure closure, Predicate predicate) { return WhileClosure.getInstance(predicate, closure, true); }
/** * Factory method that performs validation. * * @param predicate the predicate used to evaluate when the loop terminates, not null * @param closure the closure the execute, not null * @param doLoop true to act as a do-while loop, always executing the closure once * @return the <code>while</code> closure * @throws IllegalArgumentException if the predicate or closure is null */ public static Closure getInstance(Predicate predicate, Closure closure, boolean doLoop) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } if (closure == null) { throw new IllegalArgumentException("Closure must not be null"); } return new WhileClosure(predicate, closure, doLoop); }
/** * Creates a Closure that will call the closure once and then repeatedly * until the predicate returns false. * * @see org.apache.commons.collections.functors.WhileClosure * * @param closure the closure to call repeatedly, not null * @param predicate the predicate to use as an end of loop test, not null * @return the <code>do-while</code> closure * @throws IllegalArgumentException if either argument is null */ public static Closure doWhileClosure(Closure closure, Predicate predicate) { return WhileClosure.getInstance(predicate, closure, true); }
/** * Factory method that performs validation. * * @param predicate the predicate used to evaluate when the loop terminates, not null * @param closure the closure the execute, not null * @param doLoop true to act as a do-while loop, always executing the closure once * @return the <code>while</code> closure * @throws IllegalArgumentException if the predicate or closure is null */ public static Closure getInstance(Predicate predicate, Closure closure, boolean doLoop) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } if (closure == null) { throw new IllegalArgumentException("Closure must not be null"); } return new WhileClosure(predicate, closure, doLoop); }
/** * Creates a Closure that will call the closure repeatedly until the * predicate returns false. * * @see org.apache.commons.collections.functors.WhileClosure * * @param predicate the predicate to use as an end of loop test, not null * @param closure the closure to call repeatedly, not null * @return the <code>while</code> closure * @throws IllegalArgumentException if either argument is null */ public static Closure whileClosure(Predicate predicate, Closure closure) { return WhileClosure.getInstance(predicate, closure, false); }
/** * Factory method that performs validation. * * @param predicate the predicate used to evaluate when the loop terminates, not null * @param closure the closure the execute, not null * @param doLoop true to act as a do-while loop, always executing the closure once * @return the <code>while</code> closure * @throws IllegalArgumentException if the predicate or closure is null */ public static Closure getInstance(Predicate predicate, Closure closure, boolean doLoop) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } if (closure == null) { throw new IllegalArgumentException("Closure must not be null"); } return new WhileClosure(predicate, closure, doLoop); }
/** * Creates a Closure that will call the closure once and then repeatedly * until the predicate returns false. * * @see org.apache.commons.collections.functors.WhileClosure * * @param closure the closure to call repeatedly, not null * @param predicate the predicate to use as an end of loop test, not null * @return the <code>do-while</code> closure * @throws IllegalArgumentException if either argument is null */ public static Closure doWhileClosure(Closure closure, Predicate predicate) { return WhileClosure.getInstance(predicate, closure, true); }
/** * Factory method that performs validation. * * @param predicate the predicate used to evaluate when the loop terminates, not null * @param closure the closure the execute, not null * @param doLoop true to act as a do-while loop, always executing the closure once * @return the <code>while</code> closure * @throws IllegalArgumentException if the predicate or closure is null */ public static Closure getInstance(Predicate predicate, Closure closure, boolean doLoop) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } if (closure == null) { throw new IllegalArgumentException("Closure must not be null"); } return new WhileClosure(predicate, closure, doLoop); }
/** * Creates a Closure that will call the closure once and then repeatedly * until the predicate returns false. * * @see org.apache.commons.collections.functors.WhileClosure * * @param closure the closure to call repeatedly, not null * @param predicate the predicate to use as an end of loop test, not null * @return the <code>do-while</code> closure * @throws IllegalArgumentException if either argument is null */ public static Closure doWhileClosure(Closure closure, Predicate predicate) { return WhileClosure.getInstance(predicate, closure, true); }
/** * Creates a Closure that will call the closure repeatedly until the * predicate returns false. * * @see org.apache.commons.collections.functors.WhileClosure * * @param predicate the predicate to use as an end of loop test, not null * @param closure the closure to call repeatedly, not null * @return the <code>while</code> closure * @throws IllegalArgumentException if either argument is null */ public static Closure whileClosure(Predicate predicate, Closure closure) { return WhileClosure.getInstance(predicate, closure, false); }
/** * Creates a Closure that will call the closure repeatedly until the * predicate returns false. * * @see org.apache.commons.collections.functors.WhileClosure * * @param predicate the predicate to use as an end of loop test, not null * @param closure the closure to call repeatedly, not null * @return the <code>while</code> closure * @throws IllegalArgumentException if either argument is null */ public static Closure whileClosure(Predicate predicate, Closure closure) { return WhileClosure.getInstance(predicate, closure, false); }
/** * Creates a Closure that will call the closure repeatedly until the * predicate returns false. * * @see org.apache.commons.collections.functors.WhileClosure * * @param predicate the predicate to use as an end of loop test, not null * @param closure the closure to call repeatedly, not null * @return the <code>while</code> closure * @throws IllegalArgumentException if either argument is null */ public static Closure whileClosure(Predicate predicate, Closure closure) { return WhileClosure.getInstance(predicate, closure, false); }