org.hippoecm.hst.statistics
Class DefaultCounter

java.lang.Object
  extended by org.hippoecm.hst.statistics.DefaultCounter
All Implemented Interfaces:
Serializable, Counter

public class DefaultCounter
extends Object
implements Counter

DefaultCounter

Version:
$Id$
See Also:
Serialized Form

Constructor Summary
DefaultCounter()
           
DefaultCounter(long initialValue)
           
 
Method Summary
 long decrement()
          Decrements by one the current counter value.
 long getValue()
          Gets the current counter value, regardless whether it's enabled or not.
 long increment()
          Increments by one the current counter value.
 void reset()
          Resets the counter, regardless whether it's enabled or not.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultCounter

public DefaultCounter()

DefaultCounter

public DefaultCounter(long initialValue)
Method Detail

getValue

public long getValue()
Description copied from interface: Counter
Gets the current counter value, regardless whether it's enabled or not.

Specified by:
getValue in interface Counter
Returns:

increment

public long increment()
Description copied from interface: Counter
Increments by one the current counter value.

Specified by:
increment in interface Counter
Returns:
the incremented value if enabled. Otherwise, returns 0.

decrement

public long decrement()
Description copied from interface: Counter
Decrements by one the current counter value.

Specified by:
decrement in interface Counter
Returns:
the decremented value if enabled. Otherwise, returns 0.

reset

public void reset()
Description copied from interface: Counter
Resets the counter, regardless whether it's enabled or not.

Specified by:
reset in interface Counter

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2008-2012 Hippo. All Rights Reserved.