Package org.teiid.client
Class ResizingArrayList<T>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<T>
-
- org.teiid.client.ResizingArrayList<T>
-
- Type Parameters:
T
-
- All Implemented Interfaces:
Iterable<T>
,Collection<T>
,List<T>
,RandomAccess
public class ResizingArrayList<T> extends AbstractList<T> implements RandomAccess
ModifiedArrayList
that resizes up and down by powers of 2.
-
-
Field Summary
Fields Modifier and Type Field Description protected Object[]
elementData
static int
MIN_SHRINK_SIZE
protected int
size
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description ResizingArrayList()
ResizingArrayList(int initialCapacity)
ResizingArrayList(Collection<? extends T> c)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, T element)
boolean
addAll(int index, Collection<? extends T> c)
boolean
addAll(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)
-
Methods inherited from class java.util.AbstractList
add, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, remove, removeAll, retainAll, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream
-
Methods inherited from interface java.util.List
contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator
-
-
-
-
Field Detail
-
MIN_SHRINK_SIZE
public static final int MIN_SHRINK_SIZE
- See Also:
- Constant Field Values
-
elementData
protected Object[] elementData
-
size
protected int size
-
-
Constructor Detail
-
ResizingArrayList
public ResizingArrayList()
-
ResizingArrayList
public ResizingArrayList(int initialCapacity)
-
ResizingArrayList
public ResizingArrayList(Collection<? extends T> c)
-
-
Method Detail
-
get
public T get(int index)
-
getModCount
public int getModCount()
-
add
public void add(int index, T element)
-
ensureCapacity
protected void ensureCapacity(int capacity)
-
addAll
public boolean addAll(Collection<? extends T> c)
- Specified by:
addAll
in interfaceCollection<T>
- Specified by:
addAll
in interfaceList<T>
- Overrides:
addAll
in classAbstractCollection<T>
-
addAll
public boolean addAll(int index, Collection<? extends T> c)
-
remove
public T remove(int index)
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection<T>
- Specified by:
clear
in interfaceList<T>
- Overrides:
clear
in classAbstractList<T>
-
toArray
public Object[] toArray()
- Specified by:
toArray
in interfaceCollection<T>
- Specified by:
toArray
in interfaceList<T>
- Overrides:
toArray
in classAbstractCollection<T>
-
toArray
public <U> U[] toArray(U[] a)
- Specified by:
toArray
in interfaceCollection<T>
- Specified by:
toArray
in interfaceList<T>
- Overrides:
toArray
in classAbstractCollection<T>
-
size
public int size()
- Specified by:
size
in interfaceCollection<T>
- Specified by:
size
in interfaceList<T>
- Specified by:
size
in classAbstractCollection<T>
-
-