// guts of List.java package java.util; public interface List extends Collection { // Query Operations - all from Collection int size(); boolean isEmpty(); boolean contains(Object o); Iterator iterator(); Object[] toArray(); T[] toArray(T[] a); // Modification Operations - both from Collection boolean add(E o); boolean remove(Object o); // Bulk Modification Operations - all but one from Collection boolean containsAll(Collection c); boolean addAll(Collection c); boolean addAll(int index, Collection c); // new for List boolean removeAll(Collection c); boolean retainAll(Collection c); void clear(); // Comparison and hashing - both from Collection boolean equals(Object o); int hashCode(); // All remaining methods are new for List (not from Collection) // Positional Access Operations E get(int index); E set(int index, E element); void add(int index, E element); E remove(int index); // Search Operations int indexOf(Object o); int lastIndexOf(Object o); // List Iterators ListIterator listIterator(); ListIterator listIterator(int index); // View List subList(int fromIndex, int toIndex); }