uk.ac.starlink.table.join
Class TextProgressIndicator

java.lang.Object
  extended by uk.ac.starlink.table.join.TextProgressIndicator
All Implemented Interfaces:
ProgressIndicator

public class TextProgressIndicator
extends java.lang.Object
implements ProgressIndicator

ProgressIndicator which logs progress to an output stream.

Since:
24 Mar 2004

Constructor Summary
TextProgressIndicator(java.io.PrintStream out, boolean profile)
          Constructs a new indicator which will output to a given stream.
 
Method Summary
 void endStage()
          Indicates that no more ProgressIndicator.setLevel(double) calls will be made until the next ProgressIndicator.startStage(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 of ProgressIndicator.setLevel(double) calls may follow, followed by a ProgressIndicator.endStage() call.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextProgressIndicator

public TextProgressIndicator(java.io.PrintStream out,
                             boolean profile)
Constructs a new indicator which will output to a given stream.

Parameters:
out - output stream
profile - true iff profiling reports are to be made along with the normal progress log
Method Detail

startStage

public void startStage(java.lang.String stage)
Description copied from interface: ProgressIndicator
Indicates that a number of ProgressIndicator.setLevel(double) calls may follow, followed by a ProgressIndicator.endStage() call.

Specified by:
startStage in interface ProgressIndicator
Parameters:
stage - name/description of the processing stage

setLevel

public void setLevel(double level)
Description copied from interface: ProgressIndicator
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 to ProgressIndicator.startStage(java.lang.String) and ProgressIndicator.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.

Specified by:
setLevel in interface ProgressIndicator
Parameters:
level - value between 0. and 1. indicating amount of completion

endStage

public void endStage()
Description copied from interface: ProgressIndicator
Indicates that no more ProgressIndicator.setLevel(double) calls will be made until the next ProgressIndicator.startStage(java.lang.String).

Specified by:
endStage in interface ProgressIndicator

logMessage

public void logMessage(java.lang.String msg)
Description copied from interface: ProgressIndicator
Registers a comment about the progress of the algorithm. This should not be called between calls to ProgressIndicator.startStage(java.lang.String) and ProgressIndicator.endStage().

Specified by:
logMessage in interface ProgressIndicator
Parameters:
msg - message