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)
TaskMonitor
setCurrentActivity
in interface TaskMonitor
fracComplete
- the percentage done of the current activitypublic void setCurrentActivityDescription(String activity)
TaskMonitor
setCurrentActivityDescription
in interface TaskMonitor
activity
- the description of the current activitypublic void setCurrentActivityFractionComplete(double fracComplete)
TaskMonitor
setCurrentActivityFractionComplete
in interface TaskMonitor
fracComplete
- the percentage done of the current activitypublic boolean taskShouldAbort()
TaskMonitor
taskShouldAbort
in interface TaskMonitor
public String getCurrentActivityDescription()
TaskMonitor
getCurrentActivityDescription
in interface TaskMonitor
public double getCurrentActivityFractionComplete()
TaskMonitor
getCurrentActivityFractionComplete
in interface TaskMonitor
public boolean isCancelled()
TaskMonitor
isCancelled
in interface TaskMonitor
public void requestCancel()
TaskMonitor
requestCancel
in interface TaskMonitor
public void requestPause()
TaskMonitor
requestPause
in interface TaskMonitor
public void requestResume()
TaskMonitor
requestResume
in interface TaskMonitor
public boolean isPaused()
TaskMonitor
isPaused
in interface TaskMonitor
public Object getLatestResultPreview()
TaskMonitor
getLatestResultPreview
in interface TaskMonitor
public void requestResultPreview()
TaskMonitor
requestResultPreview
in interface TaskMonitor
public void requestResultPreview(ResultPreviewListener toInform)
TaskMonitor
requestResultPreview
in interface TaskMonitor
toInform
- the listener of the changes in the preview of the resultpublic boolean resultPreviewRequested()
TaskMonitor
resultPreviewRequested
in interface TaskMonitor
public void setLatestResultPreview(Object latestPreview)
TaskMonitor
setLatestResultPreview
in interface TaskMonitor
latestPreview
- the result to previewCopyright © 2014 University of Waikato, Hamilton, NZ. All Rights Reserved.