java.lang.Object | |
↳ | java.util.concurrent.atomic.AtomicLongArray |
A long
array in which elements 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 AtomicLongArray of the given length, with all
elements initially zero.
| |||||||||||
Creates a new AtomicLongArray with the same length as, and
all elements copied from, the given array.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Atomically adds the given value to the element at index
i .
| |||||||||||
Atomically sets the element at position
i to the given
updated value if the current value == the expected value.
| |||||||||||
Atomically decrements by one the element at index
i .
| |||||||||||
Gets the current value at position
i .
| |||||||||||
Atomically adds the given value to the element at index
i .
| |||||||||||
Atomically decrements by one the element at index
i .
| |||||||||||
Atomically increments by one the element at index
i .
| |||||||||||
Atomically sets the element at position
i to the given value
and returns the old value.
| |||||||||||
Atomically increments by one the element at index
i .
| |||||||||||
Eventually sets the element at position
i to the given value.
| |||||||||||
Returns the length of the array.
| |||||||||||
Sets the element at position
i to the given value.
| |||||||||||
Returns the String representation of the current values of array.
| |||||||||||
Atomically sets the element at position
i to the given
updated value if the current value == the expected value.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Creates a new AtomicLongArray of the given length, with all elements initially zero.
length | the length of the array |
---|
Creates a new AtomicLongArray with the same length as, and all elements copied from, the given array.
array | the array to copy elements from |
---|
NullPointerException | if array is null |
---|
Atomically adds the given value to the element at index i
.
i | the index |
---|---|
delta | the value to add |
Atomically sets the element at position i
to the given
updated value if the current value ==
the expected value.
i | the index |
---|---|
expect | the expected value |
update | the new value |
Atomically decrements by one the element at index i
.
i | the index |
---|
Gets the current value at position i
.
i | the index |
---|
Atomically adds the given value to the element at index i
.
i | the index |
---|---|
delta | the value to add |
Atomically decrements by one the element at index i
.
i | the index |
---|
Atomically increments by one the element at index i
.
i | the index |
---|
Atomically sets the element at position i
to the given value
and returns the old value.
i | the index |
---|---|
newValue | the new value |
Atomically increments by one the element at index i
.
i | the index |
---|
Eventually sets the element at position i
to the given value.
i | the index |
---|---|
newValue | the new value |
Returns the length of the array.
Sets the element at position i
to the given value.
i | the index |
---|---|
newValue | the new value |
Returns the String representation of the current values of array.
Atomically sets the element at position i
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
.
i | the index |
---|---|
expect | the expected value |
update | the new value |