public class CancelTaskImpl extends java.lang.Object implements CancelTask
Modifier and Type | Field and Description |
---|---|
protected boolean |
cancel |
protected boolean |
done |
protected java.lang.String |
error |
protected java.lang.String |
note |
protected int |
progress |
protected boolean |
success |
Constructor and Description |
---|
CancelTaskImpl() |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Application will call this when the user cancels.
|
java.lang.String |
getErrorMessage()
Application call this to get the error message, if any.
|
int |
getProgress()
Application call this to get the progress count, if any.
|
java.lang.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(java.lang.String error)
Called routine got an error, so it sets a message for calling program to show to user.
|
void |
setProgress(java.lang.String msg,
int progress)
Called routine may optionally show a progress message for calling program to show to user.
|
java.lang.String |
toString() |
protected boolean done
protected boolean success
protected boolean cancel
protected java.lang.String error
protected java.lang.String note
protected int progress
public boolean isSuccess()
public boolean isError()
public java.lang.String getErrorMessage()
public boolean isDone()
public void setDone(boolean done)
public void cancel()
public java.lang.String getProgressMessage()
public int getProgress()
public boolean isCancel()
CancelTask
isCancel
in interface CancelTask
public void setError(java.lang.String error)
CancelTask
setError
in interface CancelTask
error
- message to show userpublic void setProgress(java.lang.String msg, int progress)
CancelTask
setProgress
in interface CancelTask
msg
- message to show userprogress
- count of progresspublic java.lang.String toString()
toString
in class java.lang.Object