Object
|
--AbstractList
|
--Vector
Classes extended from Vector: StackutilJapha 1.0Ryan Gantt
@boolean addAll()
The get()
int indexOf()
int lastIndexOf()
int remove()
int removeRange()
int set()
AbstractList subList()
void __construct()
add()addAll()equals()get()indexOf()listIterator()remove()removeRange()set()subList()__construct()Overrides: AbstractList::addAll()
Inserts all of the elements in the specified collection into this list at the specified position (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in the list in the order that they are returned by the specified collection's iterator. The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)This implementation gets an iterator over the specified collection and iterates over it, inserting the elements obtained from the iterator into this list at the appropriate position, one at a time, using <tt> add(int, Object)</tt>. Many implementations will override this method for efficiency.
Note that this implementation throws an <tt>UnsupportedOperationException</tt> unless <tt>add(int, Object)</tt> is overridden.
<tt>true</tt> if this list changed as a result of the call.
@
NullPointerException If the specified collection is null.
@
public
IndexOutOfBoundsException Index out of range (index < 0 || index > size()).
@
IllegalArgumentException Some aspect an element of the specified collection prevents it from being added to this List.
@
ClassCastException If the class of an element of the specified collection prevents it from being added to this List.
@
UnsupportedOperationException If the addAll method is not supported by this list.
@
Overrides: AbstractList::get()
Returns the element at the specified position in this list.
element at the specified position in this list.
@
public
IndexOutOfBoundsException if the given index is out of range (index < 0 || index >= size()).
@
Overrides: AbstractList::indexOf()
Returns the index in this list of the first occurence of the specified element, or -1 if the list does not contain this element. More formally, returns the lowest index <tt>i</tt> such that <tt>(o==null ? get(i)==null : o.equals(get(i)))</tt>, or -1 if there is no such index.This implementation first gets a list iterator (with <tt>listIterator()</tt>). Then, it iterates over the list until the specified element is found or the end of the list is reached.
The index in this List of the first occurence of the specified element, or -1 if the List does not contain this element.
@
public
Returns the index in this list of the last occurence of the specified element, or -1 if the list does not contain this element. More formally, returns the highest index <tt>i</tt> such that <tt>(o==null ? get(i)==null : o.equals(get(i)))</tt>, or -1 if there is no such index.This implementation first gets a list iterator that points to the end of the list (with listIterator(size())). Then, it iterates backwards over the list until the specified element is found, or the beginning of the list is reached.
The index in this list of the last occurence of the specified element, or -1 if the list does not contain this element.
@
public
Overrides: AbstractList::remove()
Delete the value of a single list index
1 if execution was not halted
public
Overrides: AbstractList::removeRange()
Removes a range of indices from the list
1 if execution was not halted
public
Overrides: AbstractList::set()
Sets the specified index to the specified value
i if execution was not halted
public
Overrides: AbstractList::subList()
Returns a view of the portion of this list between <tt>fromIndex</tt>, inclusive, and <tt>toIndex</tt>, exclusive. (If <tt>fromIndex</tt> and <tt>toIndex</tt> are equal, the returned list is empty.) The returned list is backed by this list, so changes in the returned list are reflected in this list, and vice-versa. The returned list supports all of the optional list operations supported by this list.This method eliminates the need for explicit range operations (of the sort that commonly exist for arrays). Any operation that expects a list can be used as a range operation by operating on a subList view instead of a whole list. For example, the following idiom removes a range of elements from a list:
list.subList(from, to).clear();Similar idioms may be constructed for <tt>indexOf</tt> and <tt>lastIndexOf</tt>, and all of the algorithms in the <tt>Collections</tt> class can be applied to a subList.The semantics of the list returned by this method become undefined if the backing list (i.e., this list) is structurally modified in any way other than via the returned list. (Structural modifications are those that change the size of the list, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results.)
This implementation returns a list that subclasses <tt>AbstractList</tt>. The subclass stores, in private fields, the offset of the subList within the backing list, the size of the subList (which can change over its lifetime), and the expected <tt>modCount</tt> value of the backing list. There are two variants of the subclass, one of which implements <tt>RandomAccess</tt>. If this list implements <tt>RandomAccess</tt> the returned list will be an instance of the subclass that implements <tt>RandomAccess</tt>.
The subclass's <tt>set(int, Object)</tt>, <tt>get(int)</tt>, <tt>add(int, Object)</tt>, <tt>remove(int)</tt>, <tt>addAll(int, Collection)</tt> and <tt>removeRange(int, int)</tt> methods all delegate to the corresponding methods on the backing abstract list, after bounds-checking the index and adjusting for the offset. The <tt>addAll(Collection c)</tt> method merely returns <tt>addAll(size, c)</tt>.
The <tt>listIterator(int)</tt> method returns a "wrapper object" over a list iterator on the backing list, which is created with the corresponding method on the backing list. The <tt>iterator</tt> method merely returns <tt>listIterator()</tt>, and the <tt>size</tt> method merely returns the subclass's <tt>size</tt> field.
All methods first check to see if the actual <tt>modCount</tt> of the backing list is equal to its expected value, and throw a <tt>ConcurrentModificationException</tt> if it is not.
a view of the specified range within this list.
@
IllegalArgumentException Endpoint indices out of order (fromIndex > toIndex)
IndexOutOfBoundsException Endpoint index value out of range (fromIndex < 0 || toIndex > size)
@
public
Overrides: AbstractList::__construct()
Unified constructor. Takes no parameters. Makes a new list, and sets the mod count to zero.
Creates a new list and populates it with... nothing.