|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.core.util.backport.java.util.concurrent.atomic.AtomicReference
public class AtomicReference
An object reference that may be updated atomically. See the org.compass.core.util.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(Object initialValue)
Creates a new AtomicReference with the given initial value. |
|
| Method Summary | |
|---|---|
boolean |
compareAndSet(Object expect,
Object update)
Atomically sets the value to the given updated value if the current value == the expected value. |
Object |
get()
Gets the current value. |
Object |
getAndSet(Object newValue)
Atomically sets to the given value and returns the old value. |
void |
lazySet(Object newValue)
Eventually sets to the given value. |
void |
set(Object newValue)
Sets to the given value. |
String |
toString()
Returns the String representation of the current value. |
boolean |
weakCompareAndSet(Object expect,
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(Object initialValue)
initialValue - the initial valuepublic AtomicReference()
| Method Detail |
|---|
public final Object get()
public final void set(Object newValue)
newValue - the new valuepublic final void lazySet(Object newValue)
newValue - the new value
public final boolean compareAndSet(Object expect,
Object update)
expect - the expected valueupdate - the new value
public final boolean weakCompareAndSet(Object expect,
Object update)
expect - the expected valueupdate - the new value
public final Object getAndSet(Object newValue)
newValue - the new value
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||