bb.util
Class ProgressIndicator
java.lang.Object
bb.util.ProgressIndicator
public class ProgressIndicator
- extends Object
Class that stores the amount of progress completed by some other process.
When created (by calling begin
), this class starts a new internal thread that
mostly sleeps but wakes up periodicly and prints out the amount of progress.
The external process is responsible for updating the amount of progress by calling setPercentCompleted
.
This class is multithread safe: every public method is synchronized.
- Author:
- Brent Boyer
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
statusUpdater
private final ProgressIndicator.StatusUpdater statusUpdater
percentCompleted
private double percentCompleted
ProgressIndicator
private ProgressIndicator()
begin
public static ProgressIndicator begin()
end
public void end()
getPercentCompleted
public double getPercentCompleted()
setPercentCompleted
public void setPercentCompleted(double percentCompleted)
throws IllegalArgumentException
- Parameters:
percentCompleted
- the percentage of the overall effort that has been completed; must be expressed decimally
- Throws:
IllegalArgumentException
- if percentCompleted < 0.0 or percentCompleted > 1.0