Android
java.util
public abstract class

java.util.AbstractSequentialList<E>

java.lang.Object
java.util.AbstractCollection<E> Collection<E>
java.util.AbstractList<E> List<E>
java.util.AbstractSequentialList<E>

AbstractSequentialList is an abstract implementation of the List interface. This implementation does not support adding. A subclass must implement the abstract method listIterator().

Known Direct Subclasses

Summary

Fields inherited from class java.util.AbstractList

Protected Constructors

            AbstractSequentialList()
Constructs a new instance of this AbstractSequentialList.

Public Methods

          void  add(int location, E object)
Inserts the specified object into this List at the specified location.
          boolean  addAll(int location, Collection<? extends E> collection)
Inserts the objects in the specified Collection at the specified location in this List.
          get(int location)
Returns the element at the specified location in this List.
          Iterator<E>  iterator()
Returns an Iterator on the elements of this List.
abstract          ListIterator<E>  listIterator(int location)
Returns a ListIterator on the elements of this List.
          remove(int location)
Removes the object at the specified location from this List.
          set(int location, E object)
Replaces the element at the specified location in this List with the specified object.
Methods inherited from class java.util.AbstractList
Methods inherited from class java.util.AbstractCollection
Methods inherited from class java.lang.Object
Methods inherited from interface java.lang.Iterable
Methods inherited from interface java.util.Collection
Methods inherited from interface java.util.List

Details

Protected Constructors

protected AbstractSequentialList()

Constructs a new instance of this AbstractSequentialList.

Public Methods

public void add(int location, E object)

Inserts the specified object into this List at the specified location. The object is inserted before any previous element at the specified location. If the location is equal to the size of this List, the object is added at the end.

Parameters

location the index at which to insert
object the object to add

Throws

UnsupportedOperationException when adding to this List is not supported
ClassCastException when the class of the object is inappropriate for this List
IllegalArgumentException when the object cannot be added to this List
IndexOutOfBoundsException when location < 0 || >= size()
NullPointerException when the object is null and this List does not support null elements

public boolean addAll(int location, Collection<? extends E> collection)

Inserts the objects in the specified Collection at the specified location in this List. The objects are added in the order they are returned from the Collection iterator.

Parameters

location the index at which to insert
collection the Collection of objects

Returns

  • true if this List is modified, false otherwise

Throws

UnsupportedOperationException when adding to this List is not supported
ClassCastException when the class of an object is inappropriate for this List
IllegalArgumentException when an object cannot be added to this List
IndexOutOfBoundsException when location < 0 || >= size()

public E get(int location)

Returns the element at the specified location in this List.

Parameters

location the index of the element to return

Returns

  • the element at the specified location

Throws

IndexOutOfBoundsException when location < 0 || >= size()

public Iterator<E> iterator()

Returns an Iterator on the elements of this List. The elements are iterated in the same order that they occur in the List.

Returns

  • an Iterator on the elements of this List

See Also

public abstract ListIterator<E> listIterator(int location)

Returns a ListIterator on the elements of this List. The elements are iterated in the same order that they occur in the List. The iteration starts at the specified location.

Parameters

location the index at which to start the iteration

Returns

  • a ListIterator on the elements of this List

Throws

IndexOutOfBoundsException when location < 0 || >= size()

See Also

public E remove(int location)

Removes the object at the specified location from this List.

Parameters

location the index of the object to remove

Returns

  • the removed object

Throws

UnsupportedOperationException when removing from this List is not supported
IndexOutOfBoundsException when location < 0 || >= size()

public E set(int location, E object)

Replaces the element at the specified location in this List with the specified object.

Parameters

location the index at which to put the specified object
object the object to add

Returns

  • the previous element at the index

Throws

UnsupportedOperationException when replacing elements in this List is not supported
ClassCastException when the class of an object is inappropriate for this List
IllegalArgumentException when an object cannot be added to this List
IndexOutOfBoundsException when location < 0 || >= size()
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56