Package org.jboss.windup.util
Class ProgressEstimate
- java.lang.Object
-
- org.jboss.windup.util.ProgressEstimate
-
public class ProgressEstimate extends Object
This provides a mechanism for tracking the progress through a long running-job as well as an estimated time to completion.- Author:
- Jesse Sightler
-
-
Constructor Summary
Constructors Constructor Description ProgressEstimate(int total)Creates a newProgressEstimatefor the given number of units of work.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddWork(int worked)Indicates that the given number of work units have been done.longgetTimeRemainingInMillis()Gets the estimated time remaining in milliseconds based upon the total number of work units, the start time, and how many units have been done so far.intgetTotal()Gets the total number of work units to be done.intgetWorked()Gets the current number of work units done.
-
-
-
Constructor Detail
-
ProgressEstimate
public ProgressEstimate(int total)
Creates a newProgressEstimatefor the given number of units of work.
-
-
Method Detail
-
addWork
public void addWork(int worked)
Indicates that the given number of work units have been done.
-
getWorked
public int getWorked()
Gets the current number of work units done.
-
getTotal
public int getTotal()
Gets the total number of work units to be done.
-
getTimeRemainingInMillis
public long getTimeRemainingInMillis()
Gets the estimated time remaining in milliseconds based upon the total number of work units, the start time, and how many units have been done so far.This should not be called before any work units have been done.
-
-