org.apache.commons.collections.functors
public class ForClosure extends Object implements Closure, Serializable
Since: Commons Collections 3.0
Version: $Revision: 646777 $ $Date: 2008-04-10 13:33:15 +0100 (Thu, 10 Apr 2008) $
| Constructor Summary | |
|---|---|
| ForClosure(int count, Closure closure)
Constructor that performs no validation.
| |
| Method Summary | |
|---|---|
| void | execute(Object input)
Executes the closure count times.
|
| Closure | getClosure()
Gets the closure.
|
| int | getCount()
Gets the count.
|
| static Closure | getInstance(int count, Closure closure)
Factory method that performs validation.
|
getInstance if you want that.
Parameters: count the number of times to execute the closure closure the closure to execute, not null
count times.
Parameters: input the input object
Returns: the closure
Since: Commons Collections 3.1
Returns: the count
Since: Commons Collections 3.1
A null closure or zero count returns the NOPClosure.
A count of one returns the specified closure.
Parameters: count the number of times to execute the closure closure the closure to execute, not null
Returns: the for closure