JDK源码之List
2016-03-28 17:14
344 查看
List<E> extends Collection<E>
1. Query Operation:
int size();
boolean isEmpty();
boolean contains(Object o);
Iterator<E> iterator();
Object[] toArray();
<T> T[] toArray(T[] a);
2. Modification Operations
boolean add(E e);
boolean remove(Object o);
3. Bulk Modification Operations
boolean containsAll(Collection<?> c);
boolean addAll(Collection<? extends E> c);
boolean addAll(int index, Collection<? extends E> c);
boolean removeAll(Collection<?> c);
boolean retainAll(Collection<?> c);
void clear();
4. Comparison and hashing
boolean equals(Object o);
int hashCode();
5. Positional Access Operations
E get(int index);
E set(int index, E element);
void add(int index, E element);
E remove(int index);
6. Search Operations
int indexOf(Object o);
int lastIndexOf(Object o);
7. List Iterators
ListIterator<E> listIterator();
ListIterator<E> listIterator(int index);
8. View
List<E> subList(int fromIndex, int toIndex);
===========================
ListIterator<E> extends Iterator<E>
1. Query Operations
boolean hasNext();
E next();
boolean hasPrevious();
E previous();
int nextIndex();
int previousIndex();
2. Modification Operations
void remove(); //Removes from the list the last element that was returned by next() or previous()
void set(E e); // Replaces the last element that was returned by next() or previous()
void add(E e); // Inserts the specified element into the list, The element is inserted immediately before the element that would be returned by next(), if any, and after the element that would be returned by previous(), if any.
1. Query Operation:
int size();
boolean isEmpty();
boolean contains(Object o);
Iterator<E> iterator();
Object[] toArray();
<T> T[] toArray(T[] a);
2. Modification Operations
boolean add(E e);
boolean remove(Object o);
3. Bulk Modification Operations
boolean containsAll(Collection<?> c);
boolean addAll(Collection<? extends E> c);
boolean addAll(int index, Collection<? extends E> c);
boolean removeAll(Collection<?> c);
boolean retainAll(Collection<?> c);
void clear();
4. Comparison and hashing
boolean equals(Object o);
int hashCode();
5. Positional Access Operations
E get(int index);
E set(int index, E element);
void add(int index, E element);
E remove(int index);
6. Search Operations
int indexOf(Object o);
int lastIndexOf(Object o);
7. List Iterators
ListIterator<E> listIterator();
ListIterator<E> listIterator(int index);
8. View
List<E> subList(int fromIndex, int toIndex);
===========================
ListIterator<E> extends Iterator<E>
1. Query Operations
boolean hasNext();
E next();
boolean hasPrevious();
E previous();
int nextIndex();
int previousIndex();
2. Modification Operations
void remove(); //Removes from the list the last element that was returned by next() or previous()
void set(E e); // Replaces the last element that was returned by next() or previous()
void add(E e); // Inserts the specified element into the list, The element is inserted immediately before the element that would be returned by next(), if any, and after the element that would be returned by previous(), if any.
相关文章推荐
- java.lang.TypeNotPresentException: Type org.eclipse.jetty.maven.plugin.JettyRunMojo not present
- 跟着开涛学springmvc
- the project description file (.project) is out of sync with the file system.
- java第三次作业
- 【设计模式】Java服务开发应用策略模式的一个例子
- 基于MAVEN的spring的task 和qz 两种方式
- 礼拜一log~java Map & 层级筛选代码
- 正则表达式及java相关练习
- 浅析Java中的final关键字
- spring学习笔记(26)spring整合Quartz2持久化稳健任务调度
- JavaWeb基础---Cookie和Session
- atitit.eclipse 新特性总结3.1--4.3
- 工厂模式
- Java实现代理模式(动态代理)
- Java第三次作业
- MyEclipse中使用Maven构建Web开发项目
- JAVA-1-学习历程1:基础知识1
- Java注解
- Spring 3.x jar 包详解 与 依赖关系(转)
- Spring第十篇—举例实现AOP