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
Methods inherited from class java.util.AbstractList
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListMethods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
Constructor Details
-
UnsafeArrayList
-
-
Method Details
-
add
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
-
get
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.
-