|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Worker
Worker is the interface implemented by a user's class
which will perform the calculations associated with a particular
computation. The implementing class is also required to define the Runnable.run() method,
which will be called (potentially in a separate thread) to do all the
necessary work by the computation.
The life-cycle of an object implementing this interface is as follows:
setWorkUnit is invokedgetGUIComponent method may be invokedrun method is invokedgetPrecentageDone method may be invoked multiple timesrun method returns, indicating successful completion
getResultUnit method is invoked
| Method Summary | |
|---|---|
javax.swing.JComponent |
getGUI()
Returns a GUI component which is used to display progress and other information. |
float |
getPrecentageDone()
Returns a float which represents what precentage of the calculation
has completed. |
ResultUnit |
getResultUnit()
Returns the ResultUnit produced by the implementing class. |
void |
setWorkUnit(WorkUnit wu)
Called by the host of the Worker object, in order to provide it with a work
unit to be processed. |
| Methods inherited from interface java.lang.Runnable |
|---|
run |
| Method Detail |
|---|
void setWorkUnit(WorkUnit wu)
Worker object, in order to provide it with a work
unit to be processed.
wu - the WorkUnit to processResultUnit getResultUnit()
ResultUnit produced by the implementing class.
Computation classfloat getPrecentageDone()
float which represents what precentage of the calculation
has completed. It is also feasiable that this value cannot be calculated, in which case a -1.0
should be returned.
javax.swing.JComponent getGUI()
null should
be returned.
null if none is available
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||