|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ProgressMonitor
A class to monitor the progress of an algorithm. It allows for notification of progress, notification of cancellation, notification of pausing, and description of current work during execution. Except for the setter methods, the methods are generally only called by the algorithm with the CIShell application providing the progress monitor implementation.
Field Summary | |
---|---|
static int |
CANCELLABLE
Capability constant specifying that this algorithm can be cancelled (value is 1<<2) |
static ProgressMonitor |
NULL_MONITOR
A monitor with empty methods for use by algorithms when no ProgressMonitor has been given to it. |
static int |
PAUSEABLE
Capability constant specifying that this algorithm can be paused (value is 1<<3) |
static int |
WORK_TRACKABLE
Capability constant specifying that this algorithm can update its work progress (value is 1<<1) |
Method Summary | |
---|---|
void |
describeWork(String currentWork)
Method to describe what the algorithm is currently doing for the benefit of the users of the algorithm as it progresses during execution |
void |
done()
The algorithm is finished executing |
boolean |
isCanceled()
Returns whether cancellation of algorithm execution is requested. |
boolean |
isPaused()
Returns whether pausing of algorithm execution is requested. |
void |
setCanceled(boolean value)
Sets or clears a flag for cancellation of this algorithm's execution. |
void |
setPaused(boolean value)
Sets or clears a flag for pausing of this algorithm's execution. |
void |
start(int capabilities,
int totalWorkUnits)
Notifies the start of execution of the algorithm in addition to revealing how many work units will be used |
void |
worked(int work)
Notifies that a certain number of units of work has been completed |
Field Detail |
---|
static final ProgressMonitor NULL_MONITOR
null
checks to ensure the progress monitor is not
null
.
static final int WORK_TRACKABLE
static final int CANCELLABLE
static final int PAUSEABLE
Method Detail |
---|
void start(int capabilities, int totalWorkUnits)
capabilities
- An OR'ed int that tells the monitor what the
algorithm is capable of with respect to the
monitor. The OR'ed values are taken from the int
constants specified in this interface.totalWorkUnits
- The number of work units, -1 if the
algorithm does not provide progress informationvoid worked(int work)
work
- The number of units of work completed
since last notificationvoid done()
void setCanceled(boolean value)
value
- Set or clear the cancellation requestboolean isCanceled()
void setPaused(boolean value)
value
- Set or clear the pause requestboolean isPaused()
void describeWork(String currentWork)
currentWork
- A short description of the current work the algorithm
is doing
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |