public abstract class DefaultTask extends java.lang.Object implements Task
RESULT_ERROR, RESULT_OK, RESULT_WARNING| Constructor and Description |
|---|
DefaultTask()
Constructor for DefaultTask.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addException(java.lang.Throwable t)
Adds an exception to the reporting Stack
|
protected void |
addMessage(java.lang.String s)
Adds a message to the reporting Stack
|
void |
addTaskListener(TaskListener listener)
Method addTaskListener.
|
protected void |
fireTaskEvent(TaskEvent e)
Method fireTaskEvent.
|
int |
getMax()
Gets the maximum position.
|
java.util.Stack |
getMessages()
get the Stack of messages with either errors or warnings generated by this Task
|
int |
getMin()
Gets the mininum position.
|
int |
getPosition()
Gets the position.
|
int |
getResult()
|
boolean |
isFinished()
indicate the Task has finished
|
protected void |
progress()
Progresses the position by one, until the maximum given
by max.
|
protected void |
progress(int value)
Progresses the position by value, until the maximum given
by max.
|
void |
removeTaskListener(TaskListener listener)
Method removeTaskListener.
|
void |
setFinished(boolean b)
set the task finished
|
protected void |
setMax(int max)
Sets the maximum position
|
protected void |
setMin(int min)
Sets the minimum position
|
protected void |
setResult(int result)
set the result of this Task
result should be in
Task.RESULT_OK | Task.RESULT_ERROR | Task.RESULT_WARNING |
public boolean isFinished()
TaskisFinished in interface TaskTask.isFinished()public void setFinished(boolean b)
TasksetFinished in interface TaskTask.setFinished(boolean)public int getResult()
Taskprotected void setResult(int result)
Task.RESULT_OK | Task.RESULT_ERROR | Task.RESULT_WARNINGresult - public java.util.Stack getMessages()
TaskgetMessages in interface TaskTask.getMessages()protected void addMessage(java.lang.String s)
s - String, the message to add to the Stackprotected void addException(java.lang.Throwable t)
t - Throwable, the Exception or error that needspublic int getMax()
public int getMin()
public int getPosition()
public void addTaskListener(TaskListener listener)
listener - TaskListenerpublic void removeTaskListener(TaskListener listener)
listener - TaskListenerprotected void progress()
protected void progress(int value)
value - intprotected void fireTaskEvent(TaskEvent e)
e - TaskEventprotected void setMax(int max)
max - The max to setprotected void setMin(int min)
min - The min to set