public final class Atomics extends Object
java.util.concurrent.atomic package.
| Modifier and Type | Method and Description |
|---|---|
static <V> AtomicReference |
newReference()
Creates an
AtomicReference instance with no initial value.
|
static <V> AtomicReference |
newReference(V initialValue)
Creates an
AtomicReference instance with the given initial value.
|
static <E> AtomicReferenceArray |
newReferenceArray(E[] array)
Creates an
AtomicReferenceArray instance with the same length as, and all elements copied from, the given array.
|
static <E> AtomicReferenceArray |
newReferenceArray(int length)
Creates an
AtomicReferenceArray instance of given length.
|
public static <V> AtomicReference<V> newReference()
AtomicReference instance with no initial value.
AtomicReference with no initial value
public static <V> AtomicReference<V> newReference(V initialValue)
AtomicReference instance with the given initial value.
initialValue - the initial value
AtomicReference with the given initial value
public static <E> AtomicReferenceArray<E> newReferenceArray(int length)
AtomicReferenceArray instance of given length.
length - the length of the array
AtomicReferenceArray with the given length
public static <E> AtomicReferenceArray<E> newReferenceArray(E[] array)
AtomicReferenceArray instance with the same length as, and all elements copied from, the given array.
array - the array to copy elements from
AtomicReferenceArray copied from the given array