org.jcoderz.commons.statistics
Class TimedCounter

java.lang.Object
  extended by org.jcoderz.commons.statistics.Counter
      extended by org.jcoderz.commons.statistics.TimedCounter
All Implemented Interfaces:
Resettable

public class TimedCounter
extends Counter

TODO Write javadoc!

Author:
Albrecht Messner

Constructor Summary
TimedCounter(String name)
          Constructor.
 
Method Summary
 long getDuration()
          Returns the amount of time this Counter was running.
 double getFrequency()
          Returns the frequency of this counter, i.e. getCount() / duration.
 void reset()
          Resets the statistical entity that implements this interface.
 void start()
          Start this counter's timer.
 void stop()
          Stop this counter's timer.
 String toString()
          
 
Methods inherited from class org.jcoderz.commons.statistics.Counter
decrement, getCount, getName, increment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimedCounter

public TimedCounter(String name)
Constructor.

Parameters:
name - the name of this counter
Method Detail

start

public void start()
Start this counter's timer.


stop

public void stop()
Stop this counter's timer.


reset

public void reset()
Resets the statistical entity that implements this interface.

Specified by:
reset in interface Resettable
Overrides:
reset in class Counter

getDuration

public long getDuration()
Returns the amount of time this Counter was running.

Returns:
the amount of time this Counter was running

getFrequency

public double getFrequency()
Returns the frequency of this counter, i.e. getCount() / duration.

Returns:
the frequency of this counter, i.e. getCount() / duration.

toString

public String toString()

Overrides:
toString in class Counter


Copyright 2007 The jCoderZ Project.