org.apache.commons.collections.functors
public class ForClosure extends Object implements Closure, Serializable
Since: Commons Collections 3.0
Version: $Revision: 348444 $ $Date: 2005-11-23 14:06:56 +0000 (Wed, 23 Nov 2005) $
| 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