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.
浙公网安备 33010602011771号