| java.lang.Object org.apache.commons.collections.functors.ForClosure
ForClosure | public class ForClosure implements Closure,Serializable(Code) | | Closure implementation that calls another closure n times, like a for loop.
since: Commons Collections 3.0 version: $Revision: 348444 $ $Date: 2005-11-23 14:06:56 +0000 (Wed, 23 Nov 2005) $ author: Stephen Colebourne |
Constructor Summary | |
public | ForClosure(int count, Closure closure) Constructor that performs no validation. |
ForClosure | public ForClosure(int count, Closure closure)(Code) | | Constructor that performs no validation.
Use getInstance if you want that.
Parameters: count - the number of times to execute the closure Parameters: closure - the closure to execute, not null |
execute | public void execute(Object input)(Code) | | Executes the closure count times.
Parameters: input - the input object |
getClosure | public Closure getClosure()(Code) | | Gets the closure.
the closure since: Commons Collections 3.1 |
getCount | public int getCount()(Code) | | Gets the count.
the count since: Commons Collections 3.1 |
getInstance | public static Closure getInstance(int count, Closure closure)(Code) | | Factory method that performs validation.
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 Parameters: closure - the closure to execute, not null the for closure |
|
|