public class ListArray<T> extends AbstractList<T> implements RandomAccess
List. This implementation does not support the
List.remove(int), List.remove(Object),
List.removeAll(java.util.Collection) or List.retainAll(java.util.Collection)
operations, so the default implementations will apply, throwing an
UnsupportedOperationException.| Modifier and Type | Field and Description |
|---|---|
T[] |
array |
modCount| Constructor and Description |
|---|
ListArray(T[] array)
Construct a
ListArray with the given array. |
| Modifier and Type | Method and Description |
|---|---|
static <E> ListArray<E> |
asList(E[] array)
Convenience method to construct a
ListArray from an array. |
T |
get(int index) |
T |
set(int index,
T element) |
int |
size() |
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, subListaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArrayparallelStream, removeIf, streampublic T[] array
public ListArray(T[] array)
ListArray with the given array.array - the arrayNullPointerException - if the array is nullpublic T get(int index)
public int size()
size in interface Collection<T>size in interface List<T>size in class AbstractCollection<T>public static <E> ListArray<E> asList(E[] array)
ListArray from an array.E - the type of the array elementsarray - the arrayListArrayNullPointerException - if the array is nullCopyright © 2020. All rights reserved.