public class DefaultedList<E> extends AbstractList<E>
| Modifier and Type | Field and Description |
|---|---|
private List<E> |
delegate |
private E |
initialElement |
modCount| Modifier | Constructor and Description |
|---|---|
protected |
DefaultedList() |
protected |
DefaultedList(List<E> delegate,
E initialElement) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int value,
E element) |
void |
clear() |
static <E> DefaultedList<E> |
copyOf(E defaultValue,
E[] values) |
E |
get(int index) |
static <E> DefaultedList<E> |
of() |
static <E> DefaultedList<E> |
ofSize(int size,
E defaultValue) |
E |
remove(int index) |
E |
set(int index,
E element) |
int |
size() |
add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, 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 static <E> DefaultedList<E> of()
public static <E> DefaultedList<E> ofSize(int size, E defaultValue)
@SafeVarargs public static <E> DefaultedList<E> copyOf(E defaultValue, E[] values)
public void add(int value,
E element)
public E remove(int index)
public int size()
size in interface Collection<E>size in interface List<E>size in class AbstractCollection<E>public void clear()
clear in interface Collection<E>clear in interface List<E>clear in class AbstractList<E>