public class OverrideList<E> extends ArrayList<E>
modCount| 构造器和说明 |
|---|
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.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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, toStringcontainsAll, 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 在接口中 Collection<E>add 在接口中 List<E>add 在类中 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 在接口中 Collection<E>addAll 在接口中 List<E>addAll 在类中 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 在接口中 List<E>addAll 在类中 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.