org.jboss.jmx.adaptor.snmp.agent
Class Counter

java.lang.Object
  extended byorg.jboss.jmx.adaptor.snmp.agent.Counter

public final class Counter
extends java.lang.Object

Simple, thread safe counter implementattion with accessor methods. (Maybe replace with EDU.oswego.cs.dl.util.concurrent.SynchronizedLong?)


Constructor Summary
Counter(long countStart)
          CTOR - initialises the counter to the provided value.
 
Method Summary
 long advance()
          Returns the current value (i.e.
 long peek()
          Returns the current value (i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Counter

public Counter(long countStart)
CTOR - initialises the counter to the provided value.

Parameters:
countStart - the starting counter value
Method Detail

peek

public long peek()
Returns the current value (i.e. the next to be used).


advance

public long advance()
Returns the current value (i.e. the next to be used) and advances the counter by one.