| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
name |
| Modifier | Constructor and Description |
|---|---|
protected |
CounterImpl(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
long |
addAndGet(long delta)
Atomically adds the given value to the current value.
|
boolean |
compareAndSet(long expect,
long update)
Atomically updates the counter using a CAS operation
|
long |
decrementAndGet()
Atomically decrements the counter and returns the new value
|
long |
get()
Gets the current value of the counter
|
java.lang.String |
getName() |
long |
incrementAndGet()
Atomically increments the counter and returns the new value
|
void |
set(long new_value)
Sets the counter to a new value
|
java.lang.String |
toString() |
public long get()
Counterpublic void set(long new_value)
Counterpublic boolean compareAndSet(long expect,
long update)
CountercompareAndSet in interface Counterexpect - The expected value of the counterupdate - The new value of the counterpublic long incrementAndGet()
CounterincrementAndGet in interface Counterpublic long decrementAndGet()
CounterdecrementAndGet in interface Counterpublic long addAndGet(long delta)
Counterpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 1998-2020 Red Hat. All Rights Reserved.