public class AtomicArray<E> extends Object
AtomicReferenceArray with potential null values, easily allowing
to get the concrete values as a list using asList().| Modifier and Type | Class and Description |
|---|---|
static class |
AtomicArray.Entry<E>
An entry within the array.
|
| Constructor and Description |
|---|
AtomicArray(int size) |
| Modifier and Type | Method and Description |
|---|---|
List<AtomicArray.Entry<E>> |
asList()
Returns the it as a non null list, with an Entry wrapping each value allowing to
retain its index.
|
static <E> E |
empty() |
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 static <E> E empty()
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 List<AtomicArray.Entry<E>> asList()
Copyright © 2009–2017. All rights reserved.