factorial
Class FactorialWorker2

java.lang.Object
  extended by factorial.FactorialWorker2
All Implemented Interfaces:
Worker, java.lang.Runnable

public class FactorialWorker2
extends java.lang.Object
implements Worker


Constructor Summary
FactorialWorker2()
           
 
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 run()
           
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FactorialWorker2

public FactorialWorker2()
Method Detail

setWorkUnit

public void setWorkUnit(WorkUnit wu)
Description copied from interface: Worker
Called by the host of the Worker object, in order to provide it with a work unit to be processed.

Specified by:
setWorkUnit in interface Worker
Parameters:
wu - the WorkUnit to process

getResultUnit

public ResultUnit getResultUnit()
Description copied from interface: Worker
Returns the ResultUnit produced by the implementing class.

Specified by:
getResultUnit in interface Worker
Returns:
the ResultUnit which is conveyed to the the Computation class

getGUI

public javax.swing.JComponent getGUI()
Description copied from interface: Worker
Returns a GUI component which is used to display progress and other information. It is not mandatory to provide a fancy GUI component, in which case a null should be returned.

Specified by:
getGUI in interface Worker
Returns:
the GUI component, or null if none is available

getPrecentageDone

public float getPrecentageDone()
Description copied from interface: Worker
Returns a 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.

Specified by:
getPrecentageDone in interface Worker
Returns:
a value between 0.0 and 1.0 to indicate progress, or -1.0 if unknown

run

public void run()
Specified by:
run in interface java.lang.Runnable