Class 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 Detail

      • ProgressEstimate

        public ProgressEstimate​(int total)
        Creates a new ProgressEstimate for 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.