tools.progressbar
Class ProgressBar

java.lang.Object
  extended by tools.progressbar.AbstractProgressBar
      extended by tools.progressbar.ProgressBar
All Implemented Interfaces:
java.io.Serializable

public class ProgressBar
extends AbstractProgressBar

Draws a nice graphical ASCII/ANSI Prograss bar on the console. Auto detects if output is piped to a file or virtual console (e.g. Eclipse Output window) and simply outputs percentages in this case.

Author:
wrzodek
See Also:
Serialized Form

Constructor Summary
ProgressBar(int totalCalls)
          Initialize the progressBar object
ProgressBar(int totalCalls, boolean estimateTime)
           
ProgressBar(long totalCalls)
          Initialize the progressBar object
 
Method Summary
 void finished()
          This method is called automatically, when all calculations are finished (callNr=TotalCalls).
 
Methods inherited from class tools.progressbar.AbstractProgressBar
DisplayBar, DisplayBar, DisplayBar, getCallNumber, getEstimateTime, reset, setCallNr, setEstimateTime, setNumberOfTotalCalls
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProgressBar

public ProgressBar(int totalCalls)
Initialize the progressBar object

Parameters:
totalCalls - - how often you are planning to call the "DisplayBar" method.

ProgressBar

public ProgressBar(long totalCalls)
Initialize the progressBar object

Parameters:
totalCalls - - how often you are planning to call the "DisplayBar" method.

ProgressBar

public ProgressBar(int totalCalls,
                   boolean estimateTime)
Parameters:
aufrufeGesamt -
estimateTime -
Method Detail

finished

public void finished()
Description copied from class: AbstractProgressBar
This method is called automatically, when all calculations are finished (callNr=TotalCalls). Please implement it SYNCHRONIZED. Only call it manually, when you finish before reaching 100%.

Specified by:
finished in class AbstractProgressBar