Package ucar.nc2.util
Interface CancelTask
- All Known Implementing Classes:
CancelTaskImpl
public interface CancelTask
Allows long tasks to be cancelled. Used in potentially long method calls which the user may want the option to
cancel.
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.voidCalled 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 voidCalled routine sets whether operation successfully completed.
-
Method Details
-
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
Called routine got an error, so it sets a message for calling program to show to user.- Parameters:
msg- message to show user
-
setProgress
Called routine may optionally show a progress message for calling program to show to user.- Parameters:
msg- message to show userprogress- count of progress
-