net.spy.util
Class ProgressStats

java.lang.Object
  extended bynet.spy.util.ProgressStats

public class ProgressStats
extends Object

A simple class for keeping up with the progress of an operation.


Constructor Summary
ProgressStats(int size)
          Get an instance of ProgressStats to process the given number of things.
 
Method Summary
 double getEstimatedTimeRemaining()
          Get the estimated number of seconds remaining with the current average.
 double getEstimatedTimeRemaining(double avgProcessTime)
          Get the estimated number of seconds remaining with the given average time per unit.
 long getLastProcessTime()
          Get the number of milliseconds spent processing the last item.
 double getOverallAverage()
          Get the overall average.
 String getStats()
          Get a string representation of the processing statistics using the default format.
 String getStats(String format)
          Get a string representation fo the processing statistics.
 void start()
          Mark us having started processing something.
 void stop()
          Mark this iteration as complete.
 String toString()
          String me.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProgressStats

public ProgressStats(int size)
Get an instance of ProgressStats to process the given number of things.

Method Detail

start

public void start()
Mark us having started processing something.


stop

public void stop()
Mark this iteration as complete.


getOverallAverage

public double getOverallAverage()
Get the overall average.


getEstimatedTimeRemaining

public double getEstimatedTimeRemaining(double avgProcessTime)
Get the estimated number of seconds remaining with the given average time per unit.


getEstimatedTimeRemaining

public double getEstimatedTimeRemaining()
Get the estimated number of seconds remaining with the current average.


getLastProcessTime

public long getLastProcessTime()
Get the number of milliseconds spent processing the last item.


getStats

public String getStats(String format)
Get a string representation fo the processing statistics.

The following arguments are available to this format string.


getStats

public String getStats()
Get a string representation of the processing statistics using the default format.


toString

public String toString()
String me.

Returns:
getStats()