Interface Counter
public interface Counter
An asynchronous counter that can be used to across the cluster to maintain a consistent count.
- Author:
- Tim Fox
-
Method Summary
Modifier and TypeMethodDescriptionaddAndGet(long value) Add the value to the counter atomically and return the new countcompareAndSet(long expected, long value) Set the counter to the specified value only if the current value is the expectec value.Decrement the counter atomically and return the new countget()Get the current value of the countergetAndAdd(long value) Add the value to the counter atomically and return the value before the addIncrement the counter atomically and return the value before the increment.Increment the counter atomically and return the new count
-
Method Details
-
get
-
incrementAndGet
-
getAndIncrement
-
decrementAndGet
-
addAndGet
-
getAndAdd
-
compareAndSet
-