int
array in which elements may be updated atomically.
See the VarHandle
specification for descriptions of the
properties of atomic accesses.
Modifier and Type | Field and Description |
---|---|
private static final VarHandle | |
private final int[] | |
private static final long |
Access | Constructor and Description |
---|---|
public | AtomicIntegerArray(int
the length of the array length)Creates a new AtomicIntegerArray of the given length, with all elements initially zero. |
public | AtomicIntegerArray(int[]
the array to copy elements from array)Creates a new AtomicIntegerArray with the same length as, and all elements copied from, the given array. |
Modifier and Type | Method and Description |
---|---|
public final int | Returns: the updated valuethe index i, int the update value x, IntBinaryOperator a side-effect-free function of two arguments accumulatorFunction)Atomically updates (with memory effects as specified by |
public final int | Returns: the updated valuethe index i, int the value to add delta)Atomically adds the given value to the element at index |
public final int | Returns: the witness value, which will be the same as the expected value if successfulthe index i, int the expected value expectedValue, int the new value newValue)Atomically sets the element at index |
public final int | Returns: the witness value, which will be the same as the expected value if successfulthe index i, int the expected value expectedValue, int the new value newValue)Atomically sets the element at index |
public final int | Returns: the witness value, which will be the same as the expected value if successfulthe index i, int the expected value expectedValue, int 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, int the expected value expectedValue, int the new value newValue)Atomically sets the element at index |
public final int | Returns: the updated valuethe index i)Atomically decrements the value of the element at index |
public final int | Returns: the current valuethe index i)Returns the current value of the element at index |
public final int | Returns: the valuethe index i)Returns the current value of the element at index |
public final int | Returns: the previous valuethe index i, int the update value x, IntBinaryOperator a side-effect-free function of two arguments accumulatorFunction)Atomically updates (with memory effects as specified by |
public final int | Returns: the previous valuethe index i, int the value to add delta)Atomically adds the given value to the element at index |
public final int | Returns: the previous valuethe index i)Atomically decrements the value of the element at index |
public final int | Returns: the previous valuethe index i)Atomically increments the value of the element at index |
public final int | Returns: the previous valuethe index i, int the new value newValue)Atomically sets the element at index |
public final int | Returns: the previous valuethe index i, IntUnaryOperator a side-effect-free function updateFunction)Atomically updates (with memory effects as specified by |
public final int | Returns: the valuethe index i)Returns the current value of the element at index |
public final int | Returns: the valuethe index i)Returns the current value of the element at index |
public final int | Returns: the updated valuethe index i)Atomically increments the value of the element at index |
public final void | lazySet(int
the index i, int the new value newValue)Sets the element at index |
public final int | |
public final void | set(int
the index i, int the new value newValue)Sets the element at index |
public final void | setOpaque(int
the index i, int the new value newValue)Sets the element at index |
public final void | setPlain(int
the index i, int the new value newValue)Sets the element at index |
public final void | setRelease(int
the index i, int 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 int | Returns: the updated valuethe index i, IntUnaryOperator a side-effect-free function updateFunction)Atomically updates (with memory effects as specified by |
public final boolean | Returns: true if successfulthe index i, int the expected value expectedValue, int 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, int the expected value expectedValue, int the new value newValue)Possibly atomically sets the element at index |
public final boolean | Returns: true if successfulthe index i, int the expected value expectedValue, int the new value newValue)Possibly atomically sets the element at index |
public final boolean | Returns: true if successfulthe index i, int the expected value expectedValue, int the new value newValue)Possibly atomically sets the element at index |
public final boolean | Returns: true if successfulthe index i, int the expected value expectedValue, int 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 int[] array |
serialVersionUID | back to summary |
---|---|
private static final long serialVersionUID |
AtomicIntegerArray | back to summary |
---|---|
public AtomicIntegerArray(int length) Creates a new AtomicIntegerArray of the given length, with all elements initially zero.
|
AtomicIntegerArray | back to summary |
---|---|
public AtomicIntegerArray(int[] array) Creates a new AtomicIntegerArray with the same length as, and all elements copied from, the given array.
|
accumulateAndGet | back to summary |
---|---|
public final int accumulateAndGet(int i, int x, IntBinaryOperator accumulatorFunction) Atomically updates (with memory effects as specified by
|
addAndGet | back to summary |
---|---|
public final int addAndGet(int i, int delta) Atomically adds the given value to the element at index
|
compareAndExchange | back to summary |
---|---|
public final int compareAndExchange(int i, int expectedValue, int newValue) Atomically sets the element at index
|
compareAndExchangeAcquire | back to summary |
---|---|
public final int compareAndExchangeAcquire(int i, int expectedValue, int newValue) Atomically sets the element at index
|
compareAndExchangeRelease | back to summary |
---|---|
public final int compareAndExchangeRelease(int i, int expectedValue, int newValue) Atomically sets the element at index
|
compareAndSet | back to summary |
---|---|
public final boolean compareAndSet(int i, int expectedValue, int newValue) Atomically sets the element at index
|
decrementAndGet | back to summary |
---|---|
public final int decrementAndGet(int i) Atomically decrements the value of the element at index Equivalent to
|
get | back to summary |
---|---|
public final int get(int i) Returns the current value of the element at index
|
getAcquire | back to summary |
---|---|
public final int getAcquire(int i) Returns the current value of the element at index
|
getAndAccumulate | back to summary |
---|---|
public final int getAndAccumulate(int i, int x, IntBinaryOperator accumulatorFunction) Atomically updates (with memory effects as specified by
|
getAndAdd | back to summary |
---|---|
public final int getAndAdd(int i, int delta) Atomically adds the given value to the element at index
|
getAndDecrement | back to summary |
---|---|
public final int getAndDecrement(int i) Atomically decrements the value of the element at index Equivalent to
|
getAndIncrement | back to summary |
---|---|
public final int getAndIncrement(int i) Atomically increments the value of the element at index Equivalent to
|
getAndSet | back to summary |
---|---|
public final int getAndSet(int i, int newValue) Atomically sets the element at index
|
getAndUpdate | back to summary |
---|---|
public final int getAndUpdate(int i, IntUnaryOperator updateFunction) Atomically updates (with memory effects as specified by
|
getOpaque | back to summary |
---|---|
public final int getOpaque(int i) Returns the current value of the element at index
|
getPlain | back to summary |
---|---|
public final int getPlain(int i) Returns the current value of the element at index
|
incrementAndGet | back to summary |
---|---|
public final int incrementAndGet(int i) Atomically increments the value of the element at index Equivalent to
|
lazySet | back to summary |
---|---|
public final void lazySet(int i, int newValue) Sets the element at index
|
length | back to summary |
---|---|
public final int length() Returns the length of the array.
|
set | back to summary |
---|---|
public final void set(int i, int newValue) Sets the element at index
|
setOpaque | back to summary |
---|---|
public final void setOpaque(int i, int newValue) Sets the element at index
|
setPlain | back to summary |
---|---|
public final void setPlain(int i, int newValue) Sets the element at index
|
setRelease | back to summary |
---|---|
public final void setRelease(int i, int 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 int updateAndGet(int i, IntUnaryOperator updateFunction) Atomically updates (with memory effects as specified by
|
weakCompareAndSet | back to summary |
---|---|
public final boolean weakCompareAndSet(int i, int expectedValue, int 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, int expectedValue, int newValue) Possibly atomically sets the element at index
|
weakCompareAndSetPlain | back to summary |
---|---|
public final boolean weakCompareAndSetPlain(int i, int expectedValue, int newValue) Possibly atomically sets the element at index
|
weakCompareAndSetRelease | back to summary |
---|---|
public final boolean weakCompareAndSetRelease(int i, int expectedValue, int newValue) Possibly atomically sets the element at index
|
weakCompareAndSetVolatile | back to summary |
---|---|
public final boolean weakCompareAndSetVolatile(int i, int expectedValue, int newValue) Possibly atomically sets the element at index
|