- Enclosing class:
Counter
private static final class Counter.AtomicCounter
extends Counter
-
-
Constructor Summary
Constructors
-
Method Summary
long
Adds the given delta to the counters current value
long
Returns the counters current value
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Details
-
AtomicCounter
private AtomicCounter()
-
Method Details
-
addAndGet
public long addAndGet(long delta)
Description copied from class: Counter
Adds the given delta to the counters current value
- Specified by:
addAndGet
in class Counter
- Parameters:
delta
- the delta to add
- Returns:
- the counters updated value
-
get
public long get()
Description copied from class: Counter
Returns the counters current value
- Specified by:
get
in class Counter
- Returns:
- the counters current value