|
Griffon 0.9.5-rc2 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgriffon.util.RunnableWithArgs
public abstract class RunnableWithArgs extends Object
A Runnable that can have arguments.
Instances of this class can be seen as substitutes for Closures when dealing with non-Groovy languages. There are several Griffon core and Griffon plugin APIs that accept a RunnableWithArgs where a Closure would be used.
Example:
Runnable r = new RunnableWithArgs() { public void run(Object[] args) { System.out.println("Hello "+ args[0]); } }; r.setArgs("world!"); r.run(); // prints Hello world! r.run(new Object[]{ "again" }); // prints Hello again
Field Summary | |
---|---|
private static Object[] |
NO_ARGS
|
private Object[] |
args
|
private Object[] |
lock
|
Constructor Summary | |
RunnableWithArgs()
|
Method Summary | |
---|---|
Object[]
|
getArgs()
|
void
|
run()
|
void
|
run(Object[] args)
|
void
|
setArgs(Object[] args)
|
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Field Detail |
---|
private static final Object[] NO_ARGS
private Object[] args
private final Object[] lock
Constructor Detail |
---|
RunnableWithArgs()
Method Detail |
---|
public Object[] getArgs()
public final void run()
public void run(Object[] args)
public void setArgs(Object[] args)
Groovy Documentation