EVENT_MONITOR_CANCEL, EVENT_MONITOR_DONE, EVENT_MONITOR_NAME, EVENT_MONITOR_START, EVENT_MONITOR_STEP, STEP_UNKNOWN
Constructor and Description |
---|
NullMonitor()
Creates a new null monitor that can be used to observe a task.
|
Modifier and Type | Method and Description |
---|---|
void |
addMonitorListener(int types,
IListener listener)
Adds the specified listener for the specified set of events.
|
void |
cancel()
Called to signal that the operation has been canceled.
|
void |
done()
Called to signal that the operation has been finished.
|
java.lang.String |
getName()
Returns the name of the current operation.
|
int |
getStep()
Returns the current step of the operation.
|
int |
getTotal()
Returns the total number of steps performed by the current operation.
|
boolean |
isCanceled()
Determines whether the task should be canceled.
|
boolean |
isDone()
Determines whether the operation is still running.
|
void |
join()
Waits until the operation that is connected to the monitor
has been completed.
|
boolean |
removeMonitorListener(int types,
IListener listener)
Removes a previously registered listener from the set of
registered listeners.
|
void |
setName(java.lang.String operation)
Sets the name of the operation that is currently executed.
|
void |
start(int total)
Starts the operation and sets the total number of steps performed
by the operation.
|
void |
step(int steps)
Informs the monitor that the specified number of steps have been
performed.
|
public NullMonitor()
public void addMonitorListener(int types, IListener listener)
addMonitorListener
in interface IMonitor
types
- The types of events to register.listener
- The listener to register.public boolean removeMonitorListener(int types, IListener listener)
removeMonitorListener
in interface IMonitor
types
- The types of events to unregister.listener
- The listener to unregister.public java.lang.String getName()
public void setName(java.lang.String operation)
public void start(int total)
public int getTotal()
public void step(int steps)
public int getStep()
public void done()
public boolean isDone()
public void cancel()
public boolean isCanceled()
isCanceled
in interface IMonitor