public class CancelTaskImpl extends Object implements CancelTask
Constructor and Description |
---|
CancelTaskImpl() |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Application will call this when the user cancels.
|
String |
getErrorMessage()
Application call this to get the error message, if any.
|
int |
getProgress()
Application call this to get the progress count, if any.
|
String |
getProgressMessage()
Application call this to get the progress message, if any.
|
boolean |
isCancel()
Called routine should check often during the task and cancel the task if it returns true.
|
boolean |
isDone()
Application calls to see if task is done.
|
boolean |
isError()
Application call this to find out if there was an error.
|
boolean |
isSuccess()
Application calls to see if task is success.
|
void |
setDone(boolean done)
Application calls to see if task is done.
|
void |
setError(String error)
Called routine got an error, so it sets a message for calling program to show to user.
|
void |
setProgress(String msg,
int progress)
Called routine may optionally show a progress message for calling program to show to user.
|
String |
toString() |
public boolean isSuccess()
public boolean isError()
public String getErrorMessage()
public boolean isDone()
public void setDone(boolean done)
public void cancel()
public String getProgressMessage()
public int getProgress()
public boolean isCancel()
CancelTask
isCancel
in interface CancelTask
public void setError(String error)
CancelTask
setError
in interface CancelTask
error
- message to show userpublic void setProgress(String msg, int progress)
CancelTask
setProgress
in interface CancelTask
msg
- message to show userprogress
- count of progress