T
- the type if the list elements.public static class Conversions.WrappedArray<T>
extends java.util.AbstractList<T>
implements java.util.RandomAccess
Modifier | Constructor and Description |
---|---|
protected |
Conversions.WrappedArray(T[] array)
Internal constructor for
Conversions.WrappedArray . |
Modifier and Type | Method and Description |
---|---|
static <T> Conversions.WrappedArray<T> |
create(T[] array)
Creates a new
Conversions.WrappedArray that is backed by the given array . |
T |
get(int index) |
T[] |
internalToArray()
Returns the underlying array in an unsafe manner.
|
T |
set(int index,
T element) |
int |
size() |
java.lang.Object[] |
toArray() |
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toString
protected Conversions.WrappedArray(T[] array)
Conversions.WrappedArray
.array
- the to-be-wrapped array. May be null
which will cause any method on the created
object to fail with a NullPointerException
.public static <T> Conversions.WrappedArray<T> create(T[] array)
Conversions.WrappedArray
that is backed by the given array
.T
- the element type of the created list.array
- the to-be-wrapped array. May be null
which will cause any method on the result object
to fail with a NullPointerException
.null
.public T get(int index)
public T set(int index, T element)
set
in interface java.util.List<T>
set
in class java.util.AbstractList<T>
java.lang.NullPointerException
- if the wrapped array was null
.java.lang.ClassCastException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.IndexOutOfBoundsException
public int size()
public java.lang.Object[] toArray()