public class AtomicArray<E>
extends java.lang.Object
AtomicReferenceArray
with potential null values, easily allowing
to get the concrete values as a list using asList()
.Constructor | Description |
---|---|
AtomicArray(int size) |
Modifier and Type | Method | Description |
---|---|---|
java.util.List<E> |
asList() |
Returns the it as a non null list.
|
E |
get(int i) |
Gets the current value at position
i . |
int |
length() |
The size of the expected results, including potential null values.
|
void |
set(int i,
E value) |
Sets the element at position
i to the given value. |
void |
setOnce(int i,
E value) |
|
E[] |
toArray(E[] a) |
Copies the content of the underlying atomic array to a normal one.
|
public int length()
public void set(int i, E value)
i
to the given value.i
- the indexvalue
- the new valuepublic final void setOnce(int i, E value)
public E get(int i)
i
.i
- the indexpublic java.util.List<E> asList()