List Interface
Home ] Up ] Collection Interface ] [ List Interface ] Iterator Interface ] ListIterator Interface ] ArrayList/Iterator Example ] LinkedList Example ] Stack Class ]

 

 

The java.util.List interface (not to be confused with the java.awt.List class, which represents an AWT GUI component):

Collection
    List
    Set
        SortedSet
Comparable (in java.lang package)
Comparator
Enumeration
Iterator
    ListIterator
Map
    SortedMap

The List interface defines additional methods which support the concept of ordering within the collection:

package java.util;

public interface List extends Collection 
{
    // Modification Operations
    boolean addAll(int index, Collection c);

    // Positional Access Operations

    Object get(int index);
    Object set(int index, Object element);
    void add(int index, Object element);
    Object 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);
}

A List defines methods which are analogous to what class Vector defined in JDK 1.1.  

In JDK 1.2 and beyond, Vector extends the class AbstractList, which makes Vector a kind of List.

Object
    AbstractCollection (implements Collection)
        AbstractList (implements List)
            AbstractSequentialList
                LinkedList
            ArrayList
            Vector
                Stack
        AbstractSet (implements Set)
            HashSet
            TreeSet (implements SortedSet)
    AbstractMap (implements Map)
        HashMap
        TreeMap (implements SortedMap)
        WeakHashMap
    Dictionary
        Hashtable (implements Map)
            Properties
 

This page was last modified on 02 October, 2007