de.tomshut.util.text
Class AsciiProgressBar

java.lang.Object
  extended by de.tomshut.util.text.AsciiProgressBar

public final class AsciiProgressBar
extends java.lang.Object


Constructor Summary
AsciiProgressBar(float maxValue)
          Construct an AsciiProgressBar that prints to System.out
AsciiProgressBar(int lessThanValue)
          Construct an AsciiProgressBar that prints to System.out.
AsciiProgressBar(java.io.PrintStream out, float maxValue)
          Construct an AsciiProgressBar that prints to the PrintStream given in out
AsciiProgressBar(java.io.PrintStream out, int lessThanValue)
          Construct an AsciiProgressBar that prints to the PrintStream given in out.
 
Method Summary
 void progress(float value)
          Draw the progress bar up to the current value.
 void progressInteger(int value)
          Draw the progress bar up to the current value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsciiProgressBar

public AsciiProgressBar(float maxValue)
Construct an AsciiProgressBar that prints to System.out

Parameters:
maxValue - the maximum value that will be passed to the progress method

AsciiProgressBar

public AsciiProgressBar(java.io.PrintStream out,
                        float maxValue)
Construct an AsciiProgressBar that prints to the PrintStream given in out

Parameters:
out - the PrintStream to print the progress bar to
maxValue - the maximum value that will be passed to the progress method

AsciiProgressBar

public AsciiProgressBar(int lessThanValue)
Construct an AsciiProgressBar that prints to System.out. This is a convenience constructor that may be used for loops that count integers and terminate if the integer reaches the maximum

Parameters:
lessThanValue - the value which is one greater than the maximum value that will be passed to the progress method

AsciiProgressBar

public AsciiProgressBar(java.io.PrintStream out,
                        int lessThanValue)
Construct an AsciiProgressBar that prints to the PrintStream given in out. This is a convenience constructor that may be used for loops that count integers and terminate if the integer reaches the maximum

Parameters:
out - the PrintStream to print the progress bar to
lessThanValue - the value which is one greater than the maximum value that will be passed to the progress method
Method Detail

progress

public void progress(float value)
Draw the progress bar up to the current value. A header with a percentage scale will be printed at the first call of this method.

Parameters:
value - the current progress.

progressInteger

public void progressInteger(int value)
Draw the progress bar up to the current value. A header with a percentage scale will be printed at the first call of this method.

Parameters:
value - the current progress.