org.hbase.async
Class Counter

java.lang.Object
  extended by java.lang.Number
      extended by org.hbase.async.jsr166e.LongAdder
          extended by org.hbase.async.Counter
All Implemented Interfaces:
Serializable

public final class Counter
extends LongAdder

An atomic counter to replace AtomicLong.

This is based on JSR 166e's sharded counter, which is slated for JDK8. This class is part of the public interface of asynchbase, and code depending on asynchbase is encouraged to use it for their concurrent counter needs.

Since:
1.3
See Also:
Serialized Form

Constructor Summary
Counter()
           
 
Method Summary
 long get()
          Returns the current value of the counter.
 
Methods inherited from class org.hbase.async.jsr166e.LongAdder
add, decrement, doubleValue, floatValue, increment, intValue, longValue, reset, sum, sumThenReset, toString
 
Methods inherited from class java.lang.Number
byteValue, shortValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Counter

public Counter()
Method Detail

get

public final long get()
Returns the current value of the counter.