Package uk.ac.starlink.table.join
Class TextProgressIndicator
java.lang.Object
uk.ac.starlink.table.join.TextProgressIndicator
- All Implemented Interfaces:
ProgressIndicator
ProgressIndicator which logs progress to an output stream.
- Since:
- 24 Mar 2004
- Author:
- Mark Taylor (Starlink)
-
Method Summary
Modifier and TypeMethodDescriptionstatic TextProgressIndicatorcreateInstance(PrintStream out, boolean hasTime, boolean hasMem) Creates a TextProgressIndicator.voidendStage()Indicates that no moreProgressIndicator.setLevel(double)calls will be made until the nextProgressIndicator.startStage(java.lang.String).voidlogMessage(String msg) Registers a comment about the progress of the algorithm.voidsetLevel(double level) Specifies that the work of the most recently-started stage is a certain proportion complete.voidstartStage(String stage) Indicates that a number ofProgressIndicator.setLevel(double)calls may follow, followed by aProgressIndicator.endStage()call.
-
Method Details
-
startStage
Description copied from interface:ProgressIndicatorIndicates that a number ofProgressIndicator.setLevel(double)calls may follow, followed by aProgressIndicator.endStage()call.- Specified by:
startStagein interfaceProgressIndicator- Parameters:
stage- name/description of the processing stage
-
setLevel
public void setLevel(double level) Description copied from interface:ProgressIndicatorSpecifies that the work of the most recently-started stage is a certain proportion complete. Calls to this method must take place between paired calls toProgressIndicator.startStage(java.lang.String)andProgressIndicator.endStage(), preferably with non-decreasing values oflevel.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.
- Specified by:
setLevelin interfaceProgressIndicator- Parameters:
level- value between 0. and 1. indicating amount of completion
-
endStage
public void endStage()Description copied from interface:ProgressIndicatorIndicates that no moreProgressIndicator.setLevel(double)calls will be made until the nextProgressIndicator.startStage(java.lang.String).- Specified by:
endStagein interfaceProgressIndicator
-
logMessage
Description copied from interface:ProgressIndicatorRegisters a comment about the progress of the algorithm. This should not be called between calls toProgressIndicator.startStage(java.lang.String)andProgressIndicator.endStage().- Specified by:
logMessagein interfaceProgressIndicator- Parameters:
msg- message
-
createInstance
public static TextProgressIndicator createInstance(PrintStream out, boolean hasTime, boolean hasMem) Creates a TextProgressIndicator.- Parameters:
out- output streamhasTime- true to write time profile messageshasMem- true to write memory profile messages; note this calls System.gc() so may slow things down- Returns:
- indicator instance
-