|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.concurrent.atomic.AtomicReferenceArray
An AtomicReferenceArray maintains an array of object references in which elements may be updated atomically, and are accessed using volatile semantics.
| Constructor Summary | |
AtomicReferenceArray(int length)
Create a new AtomicReferenceArray of given length. |
|
| Method Summary | |
boolean |
compareAndSet(int i,
V expect,
V update)
Atomically set the value to the given updated value if the current value == the expected value. |
V |
get(int i)
Get the current value at position i. |
V |
getAndSet(int i,
V newValue)
Set the element at position i to the given value and return the old value. |
int |
length()
Return the length of the array. |
void |
set(int i,
V newValue)
Set the element at position i to the given value. |
boolean |
weakCompareAndSet(int i,
V expect,
V 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 AtomicReferenceArray(int length)
length - the length of the array| Method Detail |
public int length()
public V get(int i)
i - the index
public void set(int i,
V newValue)
i - the indexnewValue - the new value
public V getAndSet(int i,
V newValue)
i - the indexnewValue - the new value
public boolean compareAndSet(int i,
V expect,
V update)
i - the indexexpect - the expected valueupdate - the new value
public boolean weakCompareAndSet(int i,
V expect,
V update)
i - the indexexpect - the expected valueupdate - the new value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||