Modifier | Constructor and Description |
---|---|
protected |
COUNTER.CounterImpl(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
|
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
|
String |
toString() |
protected final String name
protected COUNTER.CounterImpl(String name)
public long get()
Counter
public void set(long new_value)
Counter
public boolean compareAndSet(long expect, long update)
Counter
compareAndSet
in interface Counter
expect
- The expected value of the counterupdate
- The new value of the counterpublic long incrementAndGet()
Counter
incrementAndGet
in interface Counter
public long decrementAndGet()
Counter
decrementAndGet
in interface Counter
public long addAndGet(long delta)
Counter
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.