Package java.util
Class AbstractSequentialList<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.AbstractSequentialList<E>
-
- All Implemented Interfaces:
Iterable<E>,Collection<E>,List<E>
- Direct Known Subclasses:
LinkedList
public abstract class AbstractSequentialList<E> extends AbstractList<E>
AbstractSequentialList is an abstract implementation of the List interface. This implementation does not support adding. A subclass must implement the abstract method listIterator().- Since:
- 1.2
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractSequentialList()Constructs a new instance of this AbstractSequentialList.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidadd(int location, E object)Inserts the specified object into this List at the specified location.booleanaddAll(int location, Collection<? extends E> collection)Inserts the objects in the specified Collection at the specified location in this List.Eget(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.Eremove(int location)Removes the object at the specified location from this list.Eset(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
add, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, size, toArray, toArray, toString
-
-
-
-
Method Detail
-
add
public void add(int location, E object)Description copied from class:AbstractListInserts 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.
-
addAll
public boolean addAll(int location, Collection<? extends E> collection)Description copied from class:AbstractListInserts 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.
-
get
public E get(int location)
Description copied from class:AbstractListReturns the element at the specified location in this list.
-
iterator
public Iterator<E> iterator()
Description copied from class:AbstractListReturns an iterator on the elements of this list. The elements are iterated in the same order as they occur in the list.
-
listIterator
public abstract ListIterator<E> listIterator(int location)
Description copied from class:AbstractListReturns 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.- Specified by:
listIteratorin interfaceList<E>- Overrides:
listIteratorin classAbstractList<E>- Parameters:
location- the index at which to start the iteration.- Returns:
- a ListIterator on the elements of this list.
- See Also:
ListIterator
-
remove
public E remove(int location)
Description copied from class:AbstractListRemoves the object at the specified location from this list.
-
set
public E set(int location, E object)
Description copied from class:AbstractListReplaces the element at the specified location in this list with the specified object.
-
-