|
Griffon 0.9.5-rc2 | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectgriffon.util.CallableWithArgs
public abstract class CallableWithArgs extends Object
A Callable 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 CallableWithArgs where a Closure would be used.
Example:
Callable<Boolean> c = new CallableWithArgs<Boolean>() {
public Boolean call(Object[] args) {
return "Hello".equals(args[0]);
}
};
c.setArgs("Hello");
assert c.call()
c.setArgs("world!");
assert !c.call();
assert !c.call(new Object[]{ "again" });
| Field Summary | |
|---|---|
private static Object[] |
NO_ARGS
|
private Object[] |
args
|
private Object[] |
lock
|
| Constructor Summary | |
CallableWithArgs()
|
|
| Method Summary | |
|---|---|
Object
|
call()
|
Object
|
call(Object[] args)
|
Object[]
|
getArgs()
|
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 |
|---|
CallableWithArgs()
| Method Detail |
|---|
public final Object call()
public Object call(Object[] args)
public Object[] getArgs()
public void setArgs(Object[] args)
Groovy Documentation