public interface ProgressIndicator
Implementations must be thread-safe; calls to setLevel(double)
may come from multiple different threads.
Modifier and Type | Method and Description |
---|---|
void |
endStage()
Indicates that no more
setLevel(double) calls will be made until
the next startStage(java.lang.String) . |
void |
logMessage(String msg)
Registers a comment about the progress of the algorithm.
|
void |
setLevel(double level)
Specifies that the work of the most recently-started stage is a certain
proportion complete.
|
void |
startStage(String stage)
Indicates that a number of
setLevel(double) calls may follow,
followed by a endStage() call. |
void startStage(String stage)
setLevel(double)
calls may follow,
followed by a endStage()
call.stage
- name/description of the processing stagevoid setLevel(double level) throws InterruptedException
startStage(java.lang.String)
and endStage()
,
preferably with non-decreasing values of level
.
The method may throw an InterruptedException as a message to the caller that the work should be interrupted. A caller which receives such an exception should stop using resources and tidy up as soon as is convenient.
level
- value between 0. and 1. indicating amount of completionInterruptedException
- as a message to the caller that the
work is no longer required
Is this abuse of InterruptedException??void endStage()
setLevel(double)
calls will be made until
the next startStage(java.lang.String)
.void logMessage(String msg)
startStage(java.lang.String)
and endStage()
.msg
- messageCopyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.