|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
public abstract class AbstractList<E>
AbstractList is an abstract implementation of the List interface, optimized for a backing store which supports random access. This implementation does not support adding or replacing. A subclass must implement the abstract methods get() and size().
| Field Summary | |
|---|---|
protected int |
modCount
|
| Constructor Summary | |
|---|---|
protected |
AbstractList()
Constructs a new instance of this AbstractList. |
| Method Summary | |
|---|---|
boolean |
add(E object)
Adds the specified object at the end of this List. |
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. |
void |
clear()
Removes all elements from this List, leaving it empty. |
boolean |
equals(Object object)
Compares the specified object to this List and answer if they are equal. |
abstract E |
get(int location)
Returns the element at the specified location in this List. |
int |
hashCode()
Returns an integer hash code for the receiver. |
int |
indexOf(Object object)
Searches this List for the specified object and returns the index of the first occurrence. |
Iterator<E> |
iterator()
Returns an Iterator on the elements of this List. |
int |
lastIndexOf(Object object)
Searches this List for the specified object and returns the index of the last occurrence. |
ListIterator<E> |
listIterator()
Returns a ListIterator on the elements of this List. |
ListIterator<E> |
listIterator(int location)
Returns a ListIterator on the elements of this List. |
E |
remove(int location)
Removes the object at the specified location from this List. |
protected void |
removeRange(int start,
int end)
Removes the objects in the specified range from the start to the, but not including, end index. |
E |
set(int location,
E object)
Replaces the element at the specified location in this List with the specified object. |
List<E> |
subList(int start,
int end)
Returns a part of consecutive elements of this list as a view. |
| Methods inherited from class java.util.AbstractCollection |
|---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, size, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, size, toArray, toArray |
| Field Detail |
|---|
protected transient int modCount
| Constructor Detail |
|---|
protected AbstractList()
| Method Detail |
|---|
public void add(int location,
E object)
add in interface List<E>location - the index at which to insertobject - the object to add
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()public boolean add(E object)
add in interface Collection<E>add in interface List<E>add in class AbstractCollection<E>object - the object to add
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
public boolean addAll(int location,
Collection<? extends E> collection)
addAll in interface List<E>location - the index at which to insertcollection - the Collection of objects
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 void clear()
clear in interface Collection<E>clear in interface List<E>clear in class AbstractCollection<E>UnsupportedOperationException - when removing from this List is not supportedList.isEmpty(),
List.size()public boolean equals(Object object)
equals in interface Collection<E>equals in interface List<E>equals in class Objectobject - the object to compare with this object
hashCode()public abstract E get(int location)
get in interface List<E>location - the index of the element to return
IndexOutOfBoundsException - when location < 0 || >= size()public int hashCode()
hashCode in interface Collection<E>hashCode in interface List<E>hashCode in class Objectequals(java.lang.Object)public int indexOf(Object object)
indexOf in interface List<E>object - the object to search for
public Iterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in interface List<E>iterator in class AbstractCollection<E>Iteratorpublic int lastIndexOf(Object object)
lastIndexOf in interface List<E>object - the object to search for
public ListIterator<E> listIterator()
listIterator in interface List<E>ListIteratorpublic ListIterator<E> listIterator(int location)
listIterator in interface List<E>location - the index at which to start the iteration
IndexOutOfBoundsException - when location < 0 || >= size()ListIteratorpublic E remove(int location)
remove in interface List<E>location - the index of the object to remove
UnsupportedOperationException - when removing from this List is not supported
IndexOutOfBoundsException - when location < 0 || >= size()
protected void removeRange(int start,
int end)
start - the index at which to start removingend - the index one past the end of the range to remove
UnsupportedOperationException - when removing from this List is not supported
IndexOutOfBoundsException - when start < 0
public E set(int location,
E object)
set in interface List<E>location - the index at which to put the specified objectobject - the object to add
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()
public List<E> subList(int start,
int end)
subList in interface List<E>start - start index of the subList, include startend - end index of the subList, exclude end
IndexOutOfBoundsException - when (start < 0 || end > size())
IllegalArgumentException - when (start > end)
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||