VarHandle specification for
descriptions of the properties of atomic accesses.
| Modifier and Type | Field and Description |
|---|---|
| private static final VarHandle | |
| private final Object[] | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | AtomicReferenceArray(int
the length of the array length)Creates a new AtomicReferenceArray of the given length, with all elements initially null. |
| public | AtomicReferenceArray(E[]
the array to copy elements from array)Creates a new AtomicReferenceArray with the same length as, and all elements copied from, the given array. |
| Modifier and Type | Method and Description |
|---|---|
| public final E | Returns: the updated valuethe index i, E the update value x, BinaryOperator<E> a side-effect-free function of two arguments accumulatorFunction)Atomically updates (with memory effects as specified by |
| public final E | Returns: the witness value, which will be the same as the expected value if successfulthe index i, E the expected value expectedValue, E the new value newValue)Atomically sets the element at index |
| public final E | Returns: the witness value, which will be the same as the expected value if successfulthe index i, E the expected value expectedValue, E the new value newValue)Atomically sets the element at index |
| public final E | Returns: the witness value, which will be the same as the expected value if successfulthe index i, E the expected value expectedValue, E the new value newValue)Atomically sets the element at index |
| public final boolean | Returns: true if successful. False return indicates that
the actual value was not equal to the expected value.the index i, E the expected value expectedValue, E the new value newValue)Atomically sets the element at index |
| public final E | Returns: the current valuethe index i)Returns the current value of the element at index |
| public final E | Returns: the valuethe index i)Returns the current value of the element at index |
| public final E | Returns: the previous valuethe index i, E the update value x, BinaryOperator<E> a side-effect-free function of two arguments accumulatorFunction)Atomically updates (with memory effects as specified by |
| public final E | Returns: the previous valuethe index i, E the new value newValue)Atomically sets the element at index |
| public final E | Returns: the previous valuethe index i, UnaryOperator<E> a side-effect-free function updateFunction)Atomically updates (with memory effects as specified by |
| public final E | Returns: the valuethe index i)Returns the current value of the element at index |
| public final E | Returns: the valuethe index i)Returns the current value of the element at index |
| public final void | lazySet(int
the index i, E the new value newValue)Sets the element at index |
| public final int | |
| private void | readObject(ObjectInputStream
the stream s)Reconstitutes the instance from a stream (that is, deserializes it). |
| public final void | set(int
the index i, E the new value newValue)Sets the element at index |
| public final void | setOpaque(int
the index i, E the new value newValue)Sets the element at index |
| public final void | setPlain(int
the index i, E the new value newValue)Sets the element at index |
| public final void | setRelease(int
the index i, E the new value newValue)Sets the element at index |
| public String | Returns: the String representation of the current values of arrayOverrides java. Returns the String representation of the current values of array. |
| public final E | Returns: the updated valuethe index i, UnaryOperator<E> a side-effect-free function updateFunction)Atomically updates (with memory effects as specified by |
| public final boolean | Returns: true if successfulthe index i, E the expected value expectedValue, E the new value newValue)
Deprecated
since 9. This method has plain memory effects but the method
name implies volatile memory effects (see methods such as
compareAndExchange and compareAndSet).
Possibly atomically sets the element at index |
| public final boolean | Returns: true if successfulthe index i, E the expected value expectedValue, E the new value newValue)Possibly atomically sets the element at index |
| public final boolean | Returns: true if successfulthe index i, E the expected value expectedValue, E the new value newValue)Possibly atomically sets the element at index |
| public final boolean | Returns: true if successfulthe index i, E the expected value expectedValue, E the new value newValue)Possibly atomically sets the element at index |
| public final boolean | Returns: true if successfulthe index i, E the expected value expectedValue, E the new value newValue)Possibly atomically sets the element at index |
| AA | back to summary |
|---|---|
| private static final VarHandle AA | |
| array | back to summary |
|---|---|
private final Object[] array
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| AtomicReferenceArray | back to summary |
|---|---|
| public AtomicReferenceArray(int length) Creates a new AtomicReferenceArray of the given length, with all elements initially null.
| |
| AtomicReferenceArray | back to summary |
|---|---|
| public AtomicReferenceArray(E[] array) Creates a new AtomicReferenceArray with the same length as, and all elements copied from, the given array.
| |
| accumulateAndGet | back to summary |
|---|---|
| public final E accumulateAndGet(int i, E x, BinaryOperator<E> accumulatorFunction) Atomically updates (with memory effects as specified by
| |
| compareAndExchange | back to summary |
|---|---|
| public final E compareAndExchange(int i, E expectedValue, E newValue) Atomically sets the element at index
| |
| compareAndExchangeAcquire | back to summary |
|---|---|
| public final E compareAndExchangeAcquire(int i, E expectedValue, E newValue) Atomically sets the element at index
| |
| compareAndExchangeRelease | back to summary |
|---|---|
| public final E compareAndExchangeRelease(int i, E expectedValue, E newValue) Atomically sets the element at index
| |
| compareAndSet | back to summary |
|---|---|
| public final boolean compareAndSet(int i, E expectedValue, E newValue) Atomically sets the element at index
| |
| get | back to summary |
|---|---|
| public final E get(int i) Returns the current value of the element at index
| |
| getAcquire | back to summary |
|---|---|
| public final E getAcquire(int i) Returns the current value of the element at index
| |
| getAndAccumulate | back to summary |
|---|---|
| public final E getAndAccumulate(int i, E x, BinaryOperator<E> accumulatorFunction) Atomically updates (with memory effects as specified by
| |
| getAndSet | back to summary |
|---|---|
| public final E getAndSet(int i, E newValue) Atomically sets the element at index
| |
| getAndUpdate | back to summary |
|---|---|
| public final E getAndUpdate(int i, UnaryOperator<E> updateFunction) Atomically updates (with memory effects as specified by
| |
| getOpaque | back to summary |
|---|---|
| public final E getOpaque(int i) Returns the current value of the element at index
| |
| getPlain | back to summary |
|---|---|
| public final E getPlain(int i) Returns the current value of the element at index
| |
| lazySet | back to summary |
|---|---|
| public final void lazySet(int i, E newValue) Sets the element at index
| |
| length | back to summary |
|---|---|
| public final int length() Returns the length of the array.
| |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException Reconstitutes the instance from a stream (that is, deserializes it).
| |
| set | back to summary |
|---|---|
| public final void set(int i, E newValue) Sets the element at index
| |
| setOpaque | back to summary |
|---|---|
| public final void setOpaque(int i, E newValue) Sets the element at index
| |
| setPlain | back to summary |
|---|---|
| public final void setPlain(int i, E newValue) Sets the element at index
| |
| setRelease | back to summary |
|---|---|
| public final void setRelease(int i, E newValue) Sets the element at index
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns the String representation of the current values of array.
| |
| updateAndGet | back to summary |
|---|---|
| public final E updateAndGet(int i, UnaryOperator<E> updateFunction) Atomically updates (with memory effects as specified by
| |
| weakCompareAndSet | back to summary |
|---|---|
| public final boolean weakCompareAndSet(int i, E expectedValue, E newValue)
Deprecated since 9. This method has plain memory effects but the method
name implies volatile memory effects (see methods such as
Possibly atomically sets the element at index
| |
| weakCompareAndSetAcquire | back to summary |
|---|---|
| public final boolean weakCompareAndSetAcquire(int i, E expectedValue, E newValue) Possibly atomically sets the element at index
| |
| weakCompareAndSetPlain | back to summary |
|---|---|
| public final boolean weakCompareAndSetPlain(int i, E expectedValue, E newValue) Possibly atomically sets the element at index
| |
| weakCompareAndSetRelease | back to summary |
|---|---|
| public final boolean weakCompareAndSetRelease(int i, E expectedValue, E newValue) Possibly atomically sets the element at index
| |
| weakCompareAndSetVolatile | back to summary |
|---|---|
| public final boolean weakCompareAndSetVolatile(int i, E expectedValue, E newValue) Possibly atomically sets the element at index
| |