|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.concurrent.atomic.AtomicLong
An AtomicLong maintains a long value that is updated atomically. See the package specification for description of the properties of atomic variables.
| Constructor Summary | |
AtomicLong()
Create a new AtomicLong with initial value 0. |
|
AtomicLong(long initialValue)
Create a new AtomicLong with the given initial value. |
|
| Method Summary | |
long |
addAndGet(long delta)
Atomically add the given value to current value. |
boolean |
compareAndSet(long expect,
long update)
Atomically set the value to the given updated value if the current value == the expected value. |
long |
decrementAndGet()
Atomically decrement by one the current value. |
long |
get()
Get the current value. |
long |
getAndAdd(long delta)
Atomically add the given value to current value. |
long |
getAndDecrement()
Atomically decrement by one the current value. |
long |
getAndIncrement()
Atomically increment by one the current value. |
long |
getAndSet(long newValue)
Set to the give value and return the old value. |
long |
incrementAndGet()
Atomically increment by one the current value. |
void |
set(long newValue)
Set to the given value. |
boolean |
weakCompareAndSet(long expect,
long update)
Atomically set the value to the given updated value if the current value == the expected value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AtomicLong(long initialValue)
initialValue - the initial valuepublic AtomicLong()
| Method Detail |
public long get()
public void set(long newValue)
newValue - the new valuepublic long getAndSet(long newValue)
newValue - the new value
public boolean compareAndSet(long expect,
long update)
expect - the expected valueupdate - the new value
public boolean weakCompareAndSet(long expect,
long update)
expect - the expected valueupdate - the new value
public long getAndIncrement()
public long getAndDecrement()
public long getAndAdd(long delta)
delta - the value to add
public long incrementAndGet()
public long decrementAndGet()
public long addAndGet(long delta)
delta - the value to add
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||