Package moa.tasks
Interface TaskMonitor
-
- All Known Implementing Classes:
NullMonitor
,StandardTaskMonitor
public interface TaskMonitor
Interface representing a task monitor.- Version:
- $Revision: 7 $
- Author:
- Richard Kirkby (rkirkby@cs.waikato.ac.nz)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getCurrentActivityDescription()
Gets the description of the current activity.double
getCurrentActivityFractionComplete()
Gets the percentage done of the current activityObject
getLatestResultPreview()
Gets the current result to previewboolean
isCancelled()
Gets whether the task monitored is cancelled.boolean
isPaused()
Gets whether the task monitored is paused.void
requestCancel()
Requests the task monitored to cancel.void
requestPause()
Requests the task monitored to pause.void
requestResultPreview()
Requests to preview the task result.void
requestResultPreview(ResultPreviewListener toInform)
Requests to preview the task result.void
requestResume()
Requests the task monitored to resume.boolean
resultPreviewRequested()
Gets whether there is a request for preview the task result.void
setCurrentActivity(String activityDescription, double fracComplete)
Sets the description and the percentage done of the current activity.void
setCurrentActivityDescription(String activity)
Sets the description of the current activity.void
setCurrentActivityFractionComplete(double fracComplete)
Sets the percentage done of the current activityvoid
setLatestResultPreview(Object latestPreview)
Sets the current result to previewboolean
taskShouldAbort()
Gets whether the task should abort.
-
-
-
Method Detail
-
setCurrentActivity
void setCurrentActivity(String activityDescription, double fracComplete)
Sets the description and the percentage done of the current activity.- Parameters:
activityDescription
- the description of the current activityfracComplete
- the percentage done of the current activity
-
setCurrentActivityDescription
void setCurrentActivityDescription(String activity)
Sets the description of the current activity.- Parameters:
activity
- the description of the current activity
-
setCurrentActivityFractionComplete
void setCurrentActivityFractionComplete(double fracComplete)
Sets the percentage done of the current activity- Parameters:
fracComplete
- the percentage done of the current activity
-
taskShouldAbort
boolean taskShouldAbort()
Gets whether the task should abort.- Returns:
- true if the task should abort
-
resultPreviewRequested
boolean resultPreviewRequested()
Gets whether there is a request for preview the task result.- Returns:
- true if there is a request for preview the task result
-
setLatestResultPreview
void setLatestResultPreview(Object latestPreview)
Sets the current result to preview- Parameters:
latestPreview
- the result to preview
-
getCurrentActivityDescription
String getCurrentActivityDescription()
Gets the description of the current activity.- Returns:
- the description of the current activity
-
getCurrentActivityFractionComplete
double getCurrentActivityFractionComplete()
Gets the percentage done of the current activity- Returns:
- the percentage done of the current activity
-
requestPause
void requestPause()
Requests the task monitored to pause.
-
requestResume
void requestResume()
Requests the task monitored to resume.
-
requestCancel
void requestCancel()
Requests the task monitored to cancel.
-
isPaused
boolean isPaused()
Gets whether the task monitored is paused.- Returns:
- true if the task is paused
-
isCancelled
boolean isCancelled()
Gets whether the task monitored is cancelled.- Returns:
- true if the task is cancelled
-
requestResultPreview
void requestResultPreview()
Requests to preview the task result.
-
requestResultPreview
void requestResultPreview(ResultPreviewListener toInform)
Requests to preview the task result.- Parameters:
toInform
- the listener of the changes in the preview of the result
-
getLatestResultPreview
Object getLatestResultPreview()
Gets the current result to preview- Returns:
- the result to preview
-
-