org.fusesource.commons.management.noop
Class StatisticImpl

java.lang.Object
  extended by org.fusesource.commons.management.noop.StatisticImpl
All Implemented Interfaces:
Statistic

public class StatisticImpl
extends java.lang.Object
implements Statistic

An implementation of the Statistic interface that acts as a sink and does nothing.

Intended for use when no management is required.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.fusesource.commons.management.Statistic
Statistic.UpdateMode
 
Constructor Summary
StatisticImpl()
           
 
Method Summary
 long getUpdateCount()
          Gets the number of times the statistic has been updated since the last reset.
 long getValue()
          Gets the current value of the statistic since the last reset.
 void increment()
          Shorthand for updateValue(1).
 void reset()
          Resets the statistic's value and update count to zero.
 void updateValue(long value)
          Update statistic value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatisticImpl

public StatisticImpl()
Method Detail

getValue

public long getValue()
Description copied from interface: Statistic
Gets the current value of the statistic since the last reset.

Specified by:
getValue in interface Statistic
Returns:
the value

getUpdateCount

public long getUpdateCount()
Description copied from interface: Statistic
Gets the number of times the statistic has been updated since the last reset.

Specified by:
getUpdateCount in interface Statistic
Returns:
the update count

increment

public void increment()
Description copied from interface: Statistic
Shorthand for updateValue(1).

Specified by:
increment in interface Statistic

updateValue

public void updateValue(long value)
Description copied from interface: Statistic
Update statistic value. The update will be applied according to the Statistic.UpdateMode

Specified by:
updateValue in interface Statistic
Parameters:
value - the value

reset

public void reset()
Description copied from interface: Statistic
Resets the statistic's value and update count to zero.

Specified by:
reset in interface Statistic


Copyright © 2009 FuseSource. All Rights Reserved.