contrib.ch.randelshofer.quaqua.util
public abstract class Worker extends java.lang.Object implements java.lang.Runnable
This class is similar to SwingWorker but less complex. Like a SwingWorker it can run using an an internal worker thread but it can also be like a Runnable object.
Constructor and Description |
---|
Worker() |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.Object |
construct()
Compute the value to be returned by the
get method. |
abstract void |
finished(java.lang.Object value)
Called on the event dispatching thread (not on the worker thread)
after the
construct method has returned. |
protected java.lang.Object |
getValue()
Get the value produced by the worker thread, or null if it
hasn't been constructed yet.
|
void |
run()
Calls #construct on the current thread and invokes
#finished on the AWT event dispatcher thread.
|
void |
start()
Starts the Worker on an internal worker thread.
|
public final void run()
run
in interface java.lang.Runnable
public abstract java.lang.Object construct()
get
method.public abstract void finished(java.lang.Object value)
construct
method has returned.value
- The return value of the construct method.protected java.lang.Object getValue()
public void start()