org.openstreetmap.osmosis.core.progress.v0_6.impl
Class ProgressTracker

java.lang.Object
  extended by org.openstreetmap.osmosis.core.progress.v0_6.impl.ProgressTracker

public class ProgressTracker
extends java.lang.Object

Maintains state about execution progress. It calculates when the next update is due, and provides statistics on execution.

Author:
Brett Henderson

Constructor Summary
ProgressTracker(int interval)
          Creates a new instance.
 
Method Summary
 double getObjectsPerSecond()
          Provides the number of objects processed per second.
 boolean updateRequired()
          Indicates if an update is due.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProgressTracker

public ProgressTracker(int interval)
Creates a new instance.

Parameters:
interval - The interval between logging progress reports in milliseconds.
Method Detail

updateRequired

public boolean updateRequired()
Indicates if an update is due. This should be called once per object that is processed.

Returns:
True if an update is due.

getObjectsPerSecond

public double getObjectsPerSecond()
Provides the number of objects processed per second. This only becomes valid after updateRequired returns true for the first time.

Returns:
The number of objects processed per second in the last timing interval.