Skip to content

Most visited

Recently visited

navigation
Added in API level 1

AbstractSequentialList

public abstract class AbstractSequentialList
extends AbstractList<E>

java.lang.Object
   ↳ java.util.AbstractCollection<E>
     ↳ java.util.AbstractList<E>
       ↳ java.util.AbstractSequentialList<E>
Known Direct Subclasses


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

Summary

Inherited fields

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.

E 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 list iterator on the elements of this list.

E remove(int location)

Removes the object at the specified location from this list.

E set(int location, E object)

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

Inherited methods

From class java.util.AbstractList
From class java.util.AbstractCollection
From class java.lang.Object
From interface java.util.List
From interface java.util.Collection
From interface java.lang.Iterable

Protected constructors

AbstractSequentialList

Added in API level 1
AbstractSequentialList ()

Constructs a new instance of this AbstractSequentialList.

Public methods

add

Added in API level 1
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.

Concrete implementations that would like to support the add functionality must override this method.

Parameters
location int: the index at which to insert.
object E: the object to add.

addAll

Added in API level 1
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's iterator.

Parameters
location int: the index at which to insert.
collection Collection: the Collection of objects
Returns
boolean true if this List is modified, false otherwise.

get

Added in API level 1
E get (int location)

Returns the element at the specified location in this list.

Parameters
location int: the index of the element to return.
Returns
E the element at the specified index.

iterator

Added in API level 1
Iterator<E> iterator ()

Returns an iterator on the elements of this list. The elements are iterated in the same order as they occur in the list.

Returns
Iterator<E> an iterator on the elements of this list.

listIterator

Added in API level 1
ListIterator<E> listIterator (int location)

Returns a list iterator on the elements of this list. The elements are iterated in the same order as they occur in the list. The iteration starts at the specified location.

Parameters
location int: the index at which to start the iteration.
Returns
ListIterator<E> a ListIterator on the elements of this list.

remove

Added in API level 1
E remove (int location)

Removes the object at the specified location from this list.

Parameters
location int: the index of the object to remove.
Returns
E the removed object.

set

Added in API level 1
E set (int location, 
                E object)

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

Parameters
location int: the index at which to put the specified object.
object E: the object to add.
Returns
E the previous element at the index.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.