public class OverrideList<E> extends ArrayList<E>
modCount| Constructor and Description |
|---|
OverrideList()
Constructs an empty list with an initial capacity of ten.
|
OverrideList(Collection<? extends E> c)
Constructs a list containing the elements of the specified
collection, in the order they are returned by the collection's
iterator.
|
OverrideList(int initialCapacity)
Constructs an empty list with the specified initial capacity.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E e)
Appends the specified element to the end of this list.
|
void |
add(int index,
E element)
Inserts the specified element at the specified position in this
list.
|
boolean |
addAll(Collection<? extends E> c)
Appends all of the elements in the specified collection to the end of
this list, in the order that they are returned by the
specified collection's Iterator.
|
boolean |
addAll(int index,
Collection<? extends E> c)
Inserts all of the elements in the specified collection into this
list, starting at the specified position.
|
E |
set(int index,
E element)
Replaces the element at the specified position in this list with
the specified element.
|
clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, size, sort, spliterator, subList, toArray, toArray, trimToSizeequals, hashCodecontainsAll, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcontainsAll, equals, hashCodeparallelStream, streampublic OverrideList()
public OverrideList(int initialCapacity)
initialCapacity - the initial capacity of the listIllegalArgumentException - if the specified initial capacity
is negativepublic OverrideList(Collection<? extends E> c)
c - the collection whose elements are to be placed into this listNullPointerException - if the specified collection is nullpublic E set(int index, E element)
public boolean add(E e)
add in interface Collection<E>add in interface List<E>add in class ArrayList<E>e - element to be appended to this listCollection.add(E))public void add(int index,
E element)
public boolean addAll(Collection<? extends E> c)
addAll in interface Collection<E>addAll in interface List<E>addAll in class ArrayList<E>c - collection containing elements to be added to this listNullPointerException - if the specified collection is nullpublic boolean addAll(int index,
Collection<? extends E> c)
addAll in interface List<E>addAll in class ArrayList<E>index - index at which to insert the first element from the
specified collectionc - collection containing elements to be added to this listIndexOutOfBoundsExceptionNullPointerException - if the specified collection is nullCopyright © 2021. All rights reserved.