86 |
|
} |
87 |
|
|
88 |
|
/** |
89 |
< |
* Replace the held array with a copy of the <code>n</code> |
89 |
> |
* Replace the held array with a copy of the <tt>n</tt> |
90 |
|
* elements of the provided array, starting at position |
91 |
< |
* <code>first</code>. To copy an entire array, call with |
91 |
> |
* <tt>first</tt>. To copy an entire array, call with |
92 |
|
* arguments (array, 0, array.length). |
93 |
|
* @param toCopyIn the array. A copy of the indicated elements of |
94 |
|
* this array is used as the |
115 |
|
/** |
116 |
|
* Tests if this list has no components. |
117 |
|
* |
118 |
< |
* @return <code>true</code> if this list has no components; |
119 |
< |
* <code>false</code> otherwise. |
118 |
> |
* @return <tt>true</tt> if this list has no components; |
119 |
> |
* <tt>false</tt> otherwise. |
120 |
|
*/ |
121 |
|
public boolean isEmpty() { |
122 |
|
return size() == 0; |
135 |
|
|
136 |
|
/** |
137 |
|
* Searches for the first occurence of the given argument, testing |
138 |
< |
* for equality using the <code>equals</code> method. |
138 |
> |
* for equality using the <tt>equals</tt> method. |
139 |
|
* |
140 |
|
* @param elem an object. |
141 |
|
* @return the index of the first occurrence of the argument in this |
142 |
< |
* list; returns <code>-1</code> if the object is not found. |
142 |
> |
* list; returns <tt>-1</tt> if the object is not found. |
143 |
|
* @see Object#equals(Object) |
144 |
|
*/ |
145 |
|
public int indexOf(Object elem) { |
168 |
|
|
169 |
|
/** |
170 |
|
* Searches for the first occurence of the given argument, beginning |
171 |
< |
* the search at <code>index</code>, and testing for equality using |
172 |
< |
* the <code>equals</code> method. |
171 |
> |
* the search at <tt>index</tt>, and testing for equality using |
172 |
> |
* the <tt>equals</tt> method. |
173 |
|
* |
174 |
|
* @param elem an object. |
175 |
|
* @param index the index to start searching from. |
176 |
|
* @return the index of the first occurrence of the object argument in |
177 |
< |
* this List at position <code>index</code> or later in the |
178 |
< |
* List; returns <code>-1</code> if the object is not found. |
177 |
> |
* this List at position <tt>index</tt> or later in the |
178 |
> |
* List; returns <tt>-1</tt> if the object is not found. |
179 |
|
* @see Object#equals(Object) |
180 |
|
*/ |
181 |
|
public int indexOf(E elem, int index) { |
417 |
|
/** |
418 |
|
* Removes a single instance of the specified element from this Collection, |
419 |
|
* if it is present (optional operation). More formally, removes an |
420 |
< |
* element <code>e</code> such that <code>(o==null ? e==null : |
421 |
< |
* o.equals(e))</code>, if the Collection contains one or more such |
420 |
> |
* element <tt>e</tt> such that <tt>(o==null ? e==null : |
421 |
> |
* o.equals(e))</tt>, if the Collection contains one or more such |
422 |
|
* elements. Returns true if the Collection contained the specified |
423 |
|
* element (or equivalently, if the Collection changed as a result of the |
424 |
|
* call). |
774 |
|
* Compares the specified Object with this List for equality. Returns true |
775 |
|
* if and only if the specified Object is also a List, both Lists have the |
776 |
|
* same size, and all corresponding pairs of elements in the two Lists are |
777 |
< |
* <em>equal</em>. (Two elements <code>e1</code> and <code>e2</code> are |
778 |
< |
* <em>equal</em> if <code>(e1==null ? e2==null : e1.equals(e2))</code>.) |
777 |
> |
* <em>equal</em>. (Two elements <tt>e1</tt> and <tt>e2</tt> are |
778 |
> |
* <em>equal</em> if <tt>(e1==null ? e2==null : e1.equals(e2))</tt>.) |
779 |
|
* In other words, two Lists are defined to be equal if they contain the |
780 |
|
* same elements in the same order. |
781 |
|
* <p> |
833 |
|
* The iterator provides a snapshot of the state of the list |
834 |
|
* when the iterator was constructed. No synchronization is |
835 |
|
* needed while traversing the iterator. The iterator does |
836 |
< |
* <em>NOT</em> support the <code>remove</code> method. |
836 |
> |
* <em>NOT</em> support the <tt>remove</tt> method. |
837 |
|
*/ |
838 |
|
public Iterator<E> iterator() { |
839 |
|
return new COWIterator<E>(array(), 0); |
844 |
|
* The iterator provides a snapshot of the state of the list |
845 |
|
* when the iterator was constructed. No synchronization is |
846 |
|
* needed while traversing the iterator. The iterator does |
847 |
< |
* <em>NOT</em> support the <code>remove</code>, <code>set</code>, |
848 |
< |
* or <code>add</code> methods. |
847 |
> |
* <em>NOT</em> support the <tt>remove</tt>, <tt>set</tt>, |
848 |
> |
* or <tt>add</tt> methods. |
849 |
|
* |
850 |
|
*/ |
851 |
|
public ListIterator<E> listIterator() { |