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

 

 

The ListIterator interface defines the additional methods necessary to support iteration though a List.  

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

It adds the ability to traverse the list in either direction, and to modify the list during iteration:

package java.util;

public interface ListIterator extends Iterator 
{
    // Query Operations

    boolean hasPrevious();
    Object previous();
    int nextIndex();
    int previousIndex();


    // Modification Operations
    
    void set(Object o);
    void add(Object o);
}
 

This page was last modified on 02 October, 2007