Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.commons.collections.functors.ForClosure
Constructor Summary | |
|
Method Summary | |
void |
|
Closure |
|
int |
|
static Closure |
|
public ForClosure(int count, Closure closure)
Constructor that performs no validation. UsegetInstance
if you want that.
- Parameters:
count
- the number of times to execute the closureclosure
- the closure to execute, not null
public void execute(Object input)
Executes the closurecount
times.
- Parameters:
input
- the input object
public Closure getClosure()
Gets the closure.
- Returns:
- the closure
- Since:
- Commons Collections 3.1
public int getCount()
Gets the count.
- Returns:
- the count
- Since:
- Commons Collections 3.1
public static Closure getInstance(int count, Closure closure)
Factory method that performs validation. A null closure or zero count returns theNOPClosure
. A count of one returns the specified closure.
- Parameters:
count
- the number of times to execute the closureclosure
- the closure to execute, not null
- Returns:
- the
for
closure