Package uk.ac.starlink.table.join
Interface ProgressIndicator
-
- All Known Implementing Classes:
NullProgressIndicator
,RangeModelProgressIndicator
,TextProgressIndicator
public interface ProgressIndicator
Callback interface for indicating how an algorithm is progressing. An instance can be passed to a time-consuming routine which will make periodic calls on it as the work progresses.Implementations must be thread-safe; calls to
setLevel(double)
may come from multiple different threads.- Since:
- 24 Mar 2004
- Author:
- Mark Taylor (Starlink)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
endStage()
Indicates that no moresetLevel(double)
calls will be made until the nextstartStage(java.lang.String)
.void
logMessage(java.lang.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(java.lang.String stage)
Indicates that a number ofsetLevel(double)
calls may follow, followed by aendStage()
call.
-
-
-
Method Detail
-
startStage
void startStage(java.lang.String stage)
Indicates that a number ofsetLevel(double)
calls may follow, followed by aendStage()
call.- Parameters:
stage
- name/description of the processing stage
-
setLevel
void setLevel(double level) throws java.lang.InterruptedException
Specifies that the work of the most recently-started stage is a certain proportion complete. Calls to this method must take place between paired calls tostartStage(java.lang.String)
andendStage()
, 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.
- Parameters:
level
- value between 0. and 1. indicating amount of completion- Throws:
java.lang.InterruptedException
- as a message to the caller that the work is no longer required Is this abuse of InterruptedException??
-
endStage
void endStage()
Indicates that no moresetLevel(double)
calls will be made until the nextstartStage(java.lang.String)
.
-
logMessage
void logMessage(java.lang.String msg)
Registers a comment about the progress of the algorithm. This should not be called between calls tostartStage(java.lang.String)
andendStage()
.- Parameters:
msg
- message
-
-