Package ucar.nc2.util
Interface CancelTask
-
- All Known Implementing Classes:
CancelTaskImpl
public interface CancelTaskAllows long tasks to be cancelled. Used in potentially long method calls which the user may want the option to cancel.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static CancelTaskcreate()booleanisCancel()Calling routine may cancel, called routine checks this method, and if true, return asap.booleanisDone()Application calls to see if task is done.voidsetDone(boolean done)Called routine sets operation was completed.voidsetError(String msg)Called routine got an error, so it sets a message for calling program to show to user.voidsetProgress(String msg, int progress)Called routine may optionally show a progress message for calling program to show to user.default voidsetSuccess()Called routine sets whether operation successfully completed.
-
-
-
Method Detail
-
create
static CancelTask create()
-
isCancel
boolean isCancel()
Calling routine may cancel, called routine checks this method, and if true, return asap.- Returns:
- true if task was cancelled
-
isDone
boolean isDone()
Application calls to see if task is done.
-
setDone
void setDone(boolean done)
Called routine sets operation was completed.
-
setSuccess
default void setSuccess()
Called routine sets whether operation successfully completed.
-
setError
void setError(String msg)
Called routine got an error, so it sets a message for calling program to show to user.- Parameters:
msg- message to show user
-
setProgress
void setProgress(String msg, int progress)
Called routine may optionally show a progress message for calling program to show to user.- Parameters:
msg- message to show userprogress- count of progress
-
-