| java.lang.Object | |
| ↳ | java.util.concurrent.atomic.AtomicReference<V> |
An object reference that may be updated atomically. See the java.util.concurrent.atomic package specification for description of the properties of atomic variables.
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Creates a new AtomicReference with the given initial value.
|
||||||||||
|
|
Creates a new AtomicReference with null initial value.
|
||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Atomically sets the value to the given updated value if the current value
== the expected value.
|
||||||||||
|
|
Gets the current value.
|
||||||||||
|
|
Atomically sets to the given value and returns the old value.
|
||||||||||
|
|
Eventually sets to the given value.
|
||||||||||
|
|
Sets to the given value.
|
||||||||||
|
|
Returns the String representation of the current value.
|
||||||||||
|
|
Atomically sets the value to the given updated value if the current value
== the expected value.
|
||||||||||
| [Expand]
Inherited Methods
|
|||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
|
|||||||||||
Creates a new AtomicReference with the given initial value.
| initialValue | the initial value |
|---|
Creates a new AtomicReference with null initial value.
Atomically sets the value to the given updated value if the current value == the expected value.
| expect | the expected value |
|---|---|
| update | the new value |
Atomically sets to the given value and returns the old value.
| newValue | the new value |
|---|
Eventually sets to the given value.
| newValue | the new value |
|---|
Sets to the given value.
| newValue | the new value |
|---|
Returns the String representation of the current value.
Atomically sets the value to the given updated value if the current value == the expected value.
May fail spuriously and does not provide ordering guarantees, so is only rarely an appropriate alternative to compareAndSet.
| expect | the expected value |
|---|---|
| update | the new value |