E
- the type of elements in this listpublic final class CopyList<E> extends java.util.AbstractList<E> implements java.util.RandomAccess
Modifier and Type | Class and Description |
---|---|
private class |
CopyList.Itr |
Modifier and Type | Field and Description |
---|---|
private E[] |
array |
private boolean |
pristine |
private int |
size |
Constructor and Description |
---|
CopyList(E[] array)
Create a List over given array.
|
CopyList(E[] array,
int size)
Create a List over given array and size.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(E element) |
void |
add(int index,
E element) |
private void |
changeCheck() |
void |
clear() |
private void |
ensureCapacity(int target) |
E |
get(int index) |
java.util.Iterator<E> |
iterator() |
private void |
rangeCheck(int index) |
E |
remove(int index) |
E |
set(int index,
E element) |
int |
size() |
addAll, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, removeRange, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public CopyList(E[] array)
array
- The initial List content. The array is never modified by the CopyList
.public int size()
public void clear()
private void rangeCheck(int index)
private void changeCheck()
private void ensureCapacity(int target)