public class StandardTaskMonitor extends Object implements TaskMonitor
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
cancelFlag |
protected String |
currentActivityDescription |
protected double |
currentActivityFractionComplete |
protected boolean |
isComplete |
protected Object |
latestResultPreview |
protected boolean |
pauseFlag |
protected ResultPreviewListener |
resultPreviewer |
protected boolean |
resultPreviewRequested |
| Constructor and Description |
|---|
StandardTaskMonitor() |
| Modifier and Type | Method and Description |
|---|---|
String |
getCurrentActivityDescription()
Gets the description of the current activity.
|
double |
getCurrentActivityFractionComplete()
Gets the percentage done of the current activity
|
Object |
getLatestResultPreview()
Gets the current result to preview
|
boolean |
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 activity
|
void |
setLatestResultPreview(Object latestPreview)
Sets the current result to preview
|
boolean |
taskShouldAbort()
Gets whether the task should abort.
|
protected String currentActivityDescription
protected double currentActivityFractionComplete
protected volatile boolean cancelFlag
protected volatile boolean pauseFlag
protected volatile boolean isComplete
protected volatile boolean resultPreviewRequested
protected volatile Object latestResultPreview
protected volatile ResultPreviewListener resultPreviewer
public void setCurrentActivity(String activityDescription, double fracComplete)
TaskMonitorsetCurrentActivity in interface TaskMonitorfracComplete - the percentage done of the current activitypublic void setCurrentActivityDescription(String activity)
TaskMonitorsetCurrentActivityDescription in interface TaskMonitoractivity - the description of the current activitypublic void setCurrentActivityFractionComplete(double fracComplete)
TaskMonitorsetCurrentActivityFractionComplete in interface TaskMonitorfracComplete - the percentage done of the current activitypublic boolean taskShouldAbort()
TaskMonitortaskShouldAbort in interface TaskMonitorpublic String getCurrentActivityDescription()
TaskMonitorgetCurrentActivityDescription in interface TaskMonitorpublic double getCurrentActivityFractionComplete()
TaskMonitorgetCurrentActivityFractionComplete in interface TaskMonitorpublic boolean isCancelled()
TaskMonitorisCancelled in interface TaskMonitorpublic void requestCancel()
TaskMonitorrequestCancel in interface TaskMonitorpublic void requestPause()
TaskMonitorrequestPause in interface TaskMonitorpublic void requestResume()
TaskMonitorrequestResume in interface TaskMonitorpublic boolean isPaused()
TaskMonitorisPaused in interface TaskMonitorpublic Object getLatestResultPreview()
TaskMonitorgetLatestResultPreview in interface TaskMonitorpublic void requestResultPreview()
TaskMonitorrequestResultPreview in interface TaskMonitorpublic void requestResultPreview(ResultPreviewListener toInform)
TaskMonitorrequestResultPreview in interface TaskMonitortoInform - the listener of the changes in the preview of the resultpublic boolean resultPreviewRequested()
TaskMonitorresultPreviewRequested in interface TaskMonitorpublic void setLatestResultPreview(Object latestPreview)
TaskMonitorsetLatestResultPreview in interface TaskMonitorlatestPreview - the result to previewCopyright © 2014 University of Waikato, Hamilton, NZ. All Rights Reserved.