org.bs.mdi
Interface Task


public interface Task

A Task is a time-consuming operation which supports returning status information.


Field Summary
static int PROGRESS_UNAVAILABLE
          Should be returned by getProgress() if the current status cannot be determined.
 
Method Summary
 int getMaximumProgress()
          Gets the maximum progress of this task, i.e. the progress value when this task has just terminated.
 int getMinimumProgress()
          Gets the minimum progress of this task, i.e. the progress value when this task hasn't done anything yet.
 String getName()
          Gets the name of this task which may be displayed to the user.
 int getProgress()
          Gets the current progress value of this task.
 boolean isActive()
          Tells if the task is currently running (active) or not.
 

Field Detail

PROGRESS_UNAVAILABLE

public static final int PROGRESS_UNAVAILABLE
Should be returned by getProgress() if the current status cannot be determined.

See Also:
Constant Field Values
Method Detail

getName

public String getName()
Gets the name of this task which may be displayed to the user.

Returns:
this task's name

isActive

public boolean isActive()
Tells if the task is currently running (active) or not.

Returns:
true if the task is active, false otherwise

getMinimumProgress

public int getMinimumProgress()
Gets the minimum progress of this task, i.e. the progress value when this task hasn't done anything yet. It is assumed that minimum and maximum progress values are non-negative and that the minimum value is small than the maximum value.

Returns:
the task's minimum progress value

getMaximumProgress

public int getMaximumProgress()
Gets the maximum progress of this task, i.e. the progress value when this task has just terminated. It is assumed that minimum and maximum progress values are non-negative and that the minimum value is small than the maximum value.

Returns:
the task's maximum progress value

getProgress

public int getProgress()
Gets the current progress value of this task. It is assumed that getMinimumProgress() <= getProgress() <= getMaximumProgress() . If the progress cannot be determined, this method should return PROGRESS_UNAVAILABLE.

Returns:
the current progress value