RunnableWithArgs (Griffon 0.9.5-rc2)
Date: 2012-03-09

Overview | Package | Class | Deprecated | Index | Help
| Griffon 0.9.5-rc2
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## griffon.util
[Java] Class RunnableWithArgs

    java.lang.Object
      griffon.util.RunnableWithArgs

All Implemented Interfaces:
  Runnable

    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

Authors:
  Andres Almiray

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

### NO_ARGS

    private static final Object[] NO_ARGS

### args

    private Object[] args

### lock

    private final Object[] lock

Constructor Detail

### RunnableWithArgs

    RunnableWithArgs()

Method Detail

### getArgs

    public Object[] getArgs()

### run

    public final void run()

### run

    public void run(Object[] args)

### setArgs

    public void setArgs(Object[] args)

Groovy Documentation