FileDocCategorySizeDatePackage
AbstractSequentialList.javaAPI DocAndroid 1.5 API3128Wed May 06 22:41:04 BST 2009java.util

AbstractSequentialList

public abstract class AbstractSequentialList extends AbstractList
AbstractSequentialList is an abstract implementation of the List interface. This implementation does not support adding. A subclass must implement the abstract method listIterator().
since
Android 1.0

Fields Summary
Constructors Summary
protected AbstractSequentialList()
Constructs a new instance of this AbstractSequentialList.

since
Android 1.0

        super();
    
Methods Summary
public voidadd(int location, E object)

        listIterator(location).add(object);
    
public booleanaddAll(int location, java.util.Collection collection)

        ListIterator<E> it = listIterator(location);
        Iterator<? extends E> colIt = collection.iterator();
        // BEGIN android-removed
        // int next = it.nextIndex();
        // while (colIt.hasNext()) {
        //     it.add(colIt.next());
        //     it.previous();
        // }
        // return next != it.nextIndex();
        // END android-removed

        // BEGIN android-added
        // BUG: previous/next inconsistant.  We care for list
        // modification NOT iterator modification.
        int size = this.size();
        while (colIt.hasNext()) {
            it.add(colIt.next());
        }
        return size != this.size();
        // END android-added
    
public Eget(int location)

        try {
            return listIterator(location).next();
        } catch (NoSuchElementException e) {
            throw new IndexOutOfBoundsException();
        }
    
public java.util.Iteratoriterator()

        return listIterator(0);
    
public abstract java.util.ListIteratorlistIterator(int location)

public Eremove(int location)

        try {
            ListIterator<E> it = listIterator(location);
            E result = it.next();
            it.remove();
            return result;
        } catch (NoSuchElementException e) {
            throw new IndexOutOfBoundsException();
        }
    
public Eset(int location, E object)

        ListIterator<E> it = listIterator(location);
        E result = it.next();
        it.set(object);
        return result;