ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/CopyOnWriteArrayList.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/CopyOnWriteArrayList.java (file contents):
Revision 1.21 by dl, Mon Dec 29 19:05:22 2003 UTC vs.
Revision 1.22 by tim, Thu Jan 15 15:10:31 2004 UTC

# Line 69 | Line 69 | public class CopyOnWriteArrayList<E>
69       * iterator.
70       * @param c the collection of initially held elements
71       */
72 <    public CopyOnWriteArrayList(Collection<E> c) {
72 >    public CopyOnWriteArrayList(Collection<? extends E> c) {
73          array = (E[]) new Object[c.size()];
74 <        Iterator<E> i = c.iterator();
74 >        Iterator<? extends E> i = c.iterator();
75          int size = 0;
76          while (i.hasNext())
77              array[size++] = i.next();
# Line 129 | Line 129 | public class CopyOnWriteArrayList<E>
129       *
130       * @param elem element whose presence in this List is to be tested.
131       * @return  <code>true</code> if the specified element is present;
132 <     *          <code>false</code> otherwise.
132 >     *          <code>false</code> otherwise.
133       */
134      public boolean contains(Object elem) {
135          E[] elementData = array();
# Line 272 | Line 272 | public class CopyOnWriteArrayList<E>
272       * Returns an array containing all of the elements in this list
273       * in the correct order.
274       * @return an array containing all of the elements in this list
275 <     *         in the correct order.
275 >     *         in the correct order.
276       */
277      public Object[] toArray() {
278          Object[] elementData = array();
# Line 326 | Line 326 | public class CopyOnWriteArrayList<E>
326       * @param  index index of element to return.
327       * @return the element at the specified position in this list.
328       * @throws    IndexOutOfBoundsException if index is out of range <tt>(index
329 <     *            &lt; 0 || index &gt;= size())</tt>.
329 >     *            &lt; 0 || index &gt;= size())</tt>.
330       */
331      public E get(int index) {
332          E[] elementData = array();
# Line 342 | Line 342 | public class CopyOnWriteArrayList<E>
342       * @param element element to be stored at the specified position.
343       * @return the element previously at the specified position.
344       * @throws    IndexOutOfBoundsException if index out of range
345 <     *            <tt>(index &lt; 0 || index &gt;= size())</tt>.
345 >     *            <tt>(index &lt; 0 || index &gt;= size())</tt>.
346       */
347      public synchronized E set(int index, E element) {
348          int len = array.length;
# Line 383 | Line 383 | public class CopyOnWriteArrayList<E>
383       * @param index index at which the specified element is to be inserted.
384       * @param element element to be inserted.
385       * @throws    IndexOutOfBoundsException if index is out of range
386 <     *            <tt>(index &lt; 0 || index &gt; size())</tt>.
386 >     *            <tt>(index &lt; 0 || index &gt; size())</tt>.
387       */
388      public synchronized void add(int index, E element) {
389          int len = array.length;
# Line 405 | Line 405 | public class CopyOnWriteArrayList<E>
405       * @param index the index of the element to removed.
406       * @return the element that was removed from the list.
407       * @throws    IndexOutOfBoundsException if index out of range <tt>(index
408 <     *            &lt; 0 || index &gt;= size())</tt>.
408 >     *            &lt; 0 || index &gt;= size())</tt>.
409       */
410      public synchronized E remove(int index) {
411          int len = array.length;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines