Package java.util
Class UnsafeArrayList<T>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<T>
-
- java.util.UnsafeArrayList<T>
-
- All Implemented Interfaces:
Iterable<T>,Collection<T>,List<T>
public class UnsafeArrayList<T> extends AbstractList<T>
An array-backed list that exposes its array.
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description UnsafeArrayList(Class<T> elementType, int initialCapacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(T element)Adds the specified object at the end of this List.T[]array()Tget(int i)Returns the element at the specified location in this list.intsize()Returns a count of how many objects thisCollectioncontains.-
Methods inherited from class java.util.AbstractList
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
-
-
-
Method Detail
-
add
public boolean add(T element)
Description copied from class:AbstractListAdds the specified object at the end of this List.- Specified by:
addin interfaceCollection<T>- Specified by:
addin interfaceList<T>- Overrides:
addin classAbstractList<T>- Parameters:
element- the object to add- Returns:
- true
-
array
public T[] array()
-
get
public T get(int i)
Description copied from class:AbstractListReturns the element at the specified location in this list.
-
size
public int size()
Description copied from class:AbstractCollectionReturns a count of how many objects thisCollectioncontains.In this class this method is declared abstract and has to be implemented by concrete
Collectionimplementations.- Specified by:
sizein interfaceCollection<T>- Specified by:
sizein interfaceList<T>- Specified by:
sizein classAbstractCollection<T>- Returns:
- how many objects this
Collectioncontains, orInteger.MAX_VALUEif there are more thanInteger.MAX_VALUEelements in thisCollection.
-
-