|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicReference
An object reference that may be updated atomically. See the edu.emory.mathcs.backport.java.util.concurrent.atomic
package specification for description
of the properties of atomic variables.
Constructor Summary | |
AtomicReference()
Creates a new AtomicReference with null initial value. |
|
AtomicReference(java.lang.Object initialValue)
Creates a new AtomicReference with the given initial value. |
Method Summary | |
boolean |
compareAndSet(java.lang.Object expect,
java.lang.Object update)
Atomically sets the value to the given updated value if the current value the expected value. |
java.lang.Object |
get()
Gets the current value. |
java.lang.Object |
getAndSet(java.lang.Object newValue)
Atomically sets to the given value and returns the old value. |
void |
lazySet(java.lang.Object newValue)
Eventually sets to the given value. |
void |
set(java.lang.Object newValue)
Sets to the given value. |
java.lang.String |
toString()
Returns the String representation of the current value. |
boolean |
weakCompareAndSet(java.lang.Object expect,
java.lang.Object update)
Atomically sets 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, wait, wait, wait |
Constructor Detail |
public AtomicReference(java.lang.Object initialValue)
initialValue
- the initial valuepublic AtomicReference()
Method Detail |
public final java.lang.Object get()
public final void set(java.lang.Object newValue)
newValue
- the new valuepublic final void lazySet(java.lang.Object newValue)
newValue
- the new valuepublic final boolean compareAndSet(java.lang.Object expect, java.lang.Object update)
expect
- the expected valueupdate
- the new value
public final boolean weakCompareAndSet(java.lang.Object expect, java.lang.Object update)
May fail spuriously and does not provide ordering guarantees, so is only rarely an appropriate alternative to .
expect
- the expected valueupdate
- the new value
public final java.lang.Object getAndSet(java.lang.Object newValue)
newValue
- the new value
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |