T
- public class ResizingArrayList<T> extends AbstractList<T> implements RandomAccess
ArrayList
that resizes up and down by powers of 2.Modifier and Type | Field and Description |
---|---|
protected Object[] |
elementData |
static int |
MIN_SHRINK_SIZE |
protected int |
size |
modCount
Constructor and Description |
---|
ResizingArrayList() |
ResizingArrayList(Collection<? extends T> c) |
ResizingArrayList(int initialCapacity) |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
T element) |
boolean |
addAll(Collection<? extends T> c) |
boolean |
addAll(int index,
Collection<? extends T> c) |
void |
clear() |
protected void |
ensureCapacity(int capacity) |
T |
get(int index) |
int |
getModCount() |
T |
remove(int index) |
T |
set(int index,
T element) |
int |
size() |
Object[] |
toArray() |
<U> U[] |
toArray(U[] a) |
add, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
contains, containsAll, isEmpty, remove, removeAll, retainAll, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator
parallelStream, removeIf, stream
public static final int MIN_SHRINK_SIZE
protected Object[] elementData
protected int size
public ResizingArrayList()
public ResizingArrayList(int initialCapacity)
public ResizingArrayList(Collection<? extends T> c)
public T get(int index)
public int getModCount()
public void add(int index, T element)
protected void ensureCapacity(int capacity)
public boolean addAll(Collection<? extends T> c)
addAll
in interface Collection<T>
addAll
in interface List<T>
addAll
in class AbstractCollection<T>
public boolean addAll(int index, Collection<? extends T> c)
public T remove(int index)
public void clear()
clear
in interface Collection<T>
clear
in interface List<T>
clear
in class AbstractList<T>
public Object[] toArray()
toArray
in interface Collection<T>
toArray
in interface List<T>
toArray
in class AbstractCollection<T>
public <U> U[] toArray(U[] a)
toArray
in interface Collection<T>
toArray
in interface List<T>
toArray
in class AbstractCollection<T>
public int size()
size
in interface Collection<T>
size
in interface List<T>
size
in class AbstractCollection<T>
Copyright © 2020. All rights reserved.