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
ModifiedArrayListthat resizes up and down by powers of 2.
-
-
Field Summary
Fields Modifier and Type Field Description protected Object[]elementDatastatic intMIN_SHRINK_SIZEprotected intsize-
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 voidadd(int index, T element)booleanaddAll(int index, Collection<? extends T> c)booleanaddAll(Collection<? extends T> c)voidclear()protected voidensureCapacity(int capacity)Tget(int index)intgetModCount()Tremove(int index)Tset(int index, T element)intsize()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:
addAllin interfaceCollection<T>- Specified by:
addAllin interfaceList<T>- Overrides:
addAllin classAbstractCollection<T>
-
addAll
public boolean addAll(int index, Collection<? extends T> c)
-
remove
public T remove(int index)
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<T>- Specified by:
clearin interfaceList<T>- Overrides:
clearin classAbstractList<T>
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<T>- Specified by:
toArrayin interfaceList<T>- Overrides:
toArrayin classAbstractCollection<T>
-
toArray
public <U> U[] toArray(U[] a)
- Specified by:
toArrayin interfaceCollection<T>- Specified by:
toArrayin interfaceList<T>- Overrides:
toArrayin classAbstractCollection<T>
-
size
public int size()
- Specified by:
sizein interfaceCollection<T>- Specified by:
sizein interfaceList<T>- Specified by:
sizein classAbstractCollection<T>
-
-