【Android API】java.util.List<E>

来源:互联网 发布:淘宝运营专才 试题 编辑:程序博客网 时间:2024/04/27 09:53

java.util.List<E>

属于公共接口,因此List<String> list = new List<String>();是无法实例化的。

已知间接子类:

Public Methodsabstract booleanadd(E object)

Adds the specified object at the end of thisList.
abstract voidadd(int location, E object)
Inserts the specified object into thisList at the specified location.
abstract booleanaddAll(Collection<? extends E> collection)
Adds the objects in the specified collection to the end of thisList.
abstract booleanaddAll(int location, Collection<? extends E> collection)
Inserts the objects in the specified collection at the specified location in thisList.
abstract voidclear()
Removes all elements from thisList, leaving it empty.
abstract booleancontains(Object object)
Tests whether thisList contains the specified object.
abstract booleancontainsAll(Collection<?> collection)
Tests whether thisList contains all objects contained in the specified collection.
abstract booleanequals(Object object)
Compares the given object with theList, and returns true if they represent the same object using a class specific comparison.
abstract Eget(int location)
Returns the element at the specified location in thisList.
abstract inthashCode()
Returns the hash code for thisList.
abstract intindexOf(Object object)
Searches thisList for the specified object and returns the index of the first occurrence.
abstract booleanisEmpty()
Returns whether thisList contains no elements.
abstractIterator<E>iterator()
Returns an iterator on the elements of thisList.
abstract intlastIndexOf(Object object)
Searches thisList for the specified object and returns the index of the last occurrence.
abstractListIterator<E>listIterator(int location)
Returns a list iterator on the elements of thisList.
abstractListIterator<E>listIterator()
Returns aList iterator on the elements of this List.
abstract Eremove(int location)
Removes the object at the specified location from thisList.
abstract booleanremove(Object object)
Removes the first occurrence of the specified object from thisList.
abstract booleanremoveAll(Collection<?> collection)
Removes all occurrences in thisList of each object in the specified collection.
abstract booleanretainAll(Collection<?> collection)
Removes all objects from thisList that are not contained in the specified collection.
abstract Eset(int location, E object)
Replaces the element at the specified location in thisList with the specified object.
abstract intsize()
Returns the number of elements in thisList.
abstractList<E>subList(int start, int end)
Returns aList of the specified portion of this List from the given start index to the end index minus one.
abstract <T> T[]toArray(T[] array)
Returns an array containing all elements contained in thisList.
abstractObject[]toArray()
Returns an array containing all elements contained in thisList.

0 0