【Android API】java.util.List<E>
2015-01-28 19:39
309 查看
java.util.List<E>
属于公共接口,因此List<String> list = new List<String>();是无法实例化的。
已知间接子类:
AbstractList
<E>,
AbstractSequentialList <E>,
ArrayList <E>,
CopyOnWriteArrayList <E>,
LinkedList <E>,
Stack <E>,
Vector <E> 可以通过这些类来实例化。比如:
List<String> list = new ArrayList<String>();
属于公共接口,因此List<String> list = new List<String>();是无法实例化的。
已知间接子类:
AbstractList
<E>,
AbstractSequentialList <E>,
ArrayList <E>,
CopyOnWriteArrayList <E>,
LinkedList <E>,
Stack <E>,
Vector <E> 可以通过这些类来实例化。比如:
List<String> list = new ArrayList<String>();
Public Methods | |
---|---|
abstract boolean | add(E object) Adds the specified object at the end of this List. |
abstract void | add(int location, E object) Inserts the specified object into this Listat the specified location. |
abstract boolean | addAll(Collection<? extends E> collection) Adds the objects in the specified collection to the end of this List. |
abstract boolean | addAll(int location, Collection<? extends E> collection) Inserts the objects in the specified collection at the specified location in this List. |
abstract void | clear() Removes all elements from this List, leaving it empty. |
abstract boolean | contains(Object object) Tests whether this Listcontains the specified object. |
abstract boolean | containsAll(Collection<?> collection) Tests whether this Listcontains all objects contained in the specified collection. |
abstract boolean | equals(Object object) Compares the given object with the List, and returns true if they represent the same object using a class specific comparison. |
abstract E | get(int location) Returns the element at the specified location in this List. |
abstract int | hashCode() Returns the hash code for this List. |
abstract int | indexOf(Object object) Searches this Listfor the specified object and returns the index of the first occurrence. |
abstract boolean | isEmpty() Returns whether this Listcontains no elements. |
abstract Iterator<E> | iterator() Returns an iterator on the elements of this List. |
abstract int | lastIndexOf(Object object) Searches this Listfor the specified object and returns the index of the last occurrence. |
abstract ListIterator<E> | listIterator(int location) Returns a list iterator on the elements of this List. |
abstract ListIterator<E> | listIterator() Returns a Listiterator on the elements of this List. |
abstract E | remove(int location) Removes the object at the specified location from this List. |
abstract boolean | remove(Object object) Removes the first occurrence of the specified object from this List. |
abstract boolean | removeAll(Collection<?> collection) Removes all occurrences in this Listof each object in the specified collection. |
abstract boolean | retainAll(Collection<?> collection) Removes all objects from this Listthat are not contained in the specified collection. |
abstract E | set(int location, E object) Replaces the element at the specified location in this Listwith the specified object. |
abstract int | size() Returns the number of elements in this List. |
abstract List<E> | subList(int start, int end) Returns a Listof the specified portion of this Listfrom the given start index to the end index minus one. |
abstract <T> T[] | %29]toArray(T[] array) Returns an array containing all elements contained in this List. |
abstract Object[] | toArray() Returns an array containing all elements contained in this List. |
相关文章推荐
- 用反射属性类型为:java.util.List<com.abc.User>
- android Collections.sort(List<T> list) 与JAVA Collections.sort(List<T> list)
- java中的泛型———List<>
- List<Entity>排序:根据javabean中的一个字段对beanList进行排序
- 在Java中将数据库查询结果保存为List<Map>类型的JavaScript数组文件
- java.util.prefs.WindowsPreferences <init>异常警告
- Java使用synchronized实现多线程操作list<1>
- java List<Long[]> 截取
- java list<string>集合 传递值给js的数组
- Java基础List<Map<String, String>>
- java 将jso 格式的字符串转换为List<Map<String,String>>
- Java基础<十一>--->集合之List、Set
- 利用java反射机制实现List<Map<String, Object>>转化为List<JavaBean>
- Java List<Object>根据Object中某一个属性排序
- android Collections.sort(List<T> list) 与JAVA Collections.sort(List<T> list)
- JAVA List<Object[]>取值问题
- JAVA List<> 合并去重
- 关于在freemarker模板中遍历数据模型List<JavaBean>的经验
- java 导出List<T>数据 为 exsl文件
- 在JavaScript中实现类似Java中List<Map>类型的数组