org.virion.jam.util
Class LongTask

java.lang.Object
  extended by org.virion.jam.util.LongTask
Direct Known Subclasses:
SimpleLongTask

public abstract class LongTask
extends Object


Constructor Summary
LongTask()
           
 
Method Summary
 boolean done()
          Called to find out if the task has completed.
abstract  Object doWork()
          Does the actual work and returns some kind of result.
 Object getAnswer()
           
abstract  int getCurrent()
          Called to find out how much has been done.
 String getDescription()
          Called to get the description of this task.
abstract  int getLengthOfTask()
          Called to find out how much work needs to be done.
abstract  String getMessage()
          Called to get the current message of the task.
 void go()
          Called to start the task.
 void stop()
          Called to stop task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LongTask

public LongTask()
Method Detail

doWork

public abstract Object doWork()
                       throws Exception
Does the actual work and returns some kind of result.

Throws:
Exception

go

public final void go()
Called to start the task.


getAnswer

public final Object getAnswer()

getLengthOfTask

public abstract int getLengthOfTask()
Called to find out how much work needs to be done.


getCurrent

public abstract int getCurrent()
Called to find out how much has been done.


stop

public void stop()
Called to stop task.


done

public boolean done()
Called to find out if the task has completed.


getMessage

public abstract String getMessage()
Called to get the current message of the task.


getDescription

public String getDescription()
Called to get the description of this task.