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

Comparing jsr166/src/main/java/util/AbstractList.java (file contents):
Revision 1.13 by jsr166, Mon Jun 26 01:02:38 2006 UTC vs.
Revision 1.17 by jsr166, Sun May 20 07:54:01 2007 UTC

# Line 1 | Line 1
1   /*
2 < * %W% %E%
2 > * Copyright 1997-2006 Sun Microsystems, Inc.  All Rights Reserved.
3 > * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4   *
5 < * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
6 < * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
5 > * This code is free software; you can redistribute it and/or modify it
6 > * under the terms of the GNU General Public License version 2 only, as
7 > * published by the Free Software Foundation.  Sun designates this
8 > * particular file as subject to the "Classpath" exception as provided
9 > * by Sun in the LICENSE file that accompanied this code.
10 > *
11 > * This code is distributed in the hope that it will be useful, but WITHOUT
12 > * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 > * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 > * version 2 for more details (a copy is included in the LICENSE file that
15 > * accompanied this code).
16 > *
17 > * You should have received a copy of the GNU General Public License version
18 > * 2 along with this work; if not, write to the Free Software Foundation,
19 > * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 > *
21 > * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 > * CA 95054 USA or visit www.sun.com if you need additional information or
23 > * have any questions.
24   */
25  
26   package java.util;
# Line 250 | Line 268 | public abstract class AbstractList<E> ex
268      // Iterators
269  
270      /**
271 <     * Returns an iterator over the elements in this list in proper
254 <     * sequence.
271 >     * Returns an iterator over the elements in this list in proper sequence.
272       *
273       * <p>This implementation returns a straightforward implementation of the
274       * iterator interface, relying on the backing list's {@code size()},
# Line 292 | Line 309 | public abstract class AbstractList<E> ex
309       * {@code ListIterator} interface that extends the implementation of the
310       * {@code Iterator} interface returned by the {@code iterator()} method.
311       * The {@code ListIterator} implementation relies on the backing list's
312 <     * {@code get(int)}, {@code set(int, E)}, {@code add(int, Object)}
312 >     * {@code get(int)}, {@code set(int, E)}, {@code add(int, E)}
313       * and {@code remove(int)} methods.
314       *
315       * <p>Note that the list iterator returned by this implementation will
# Line 444 | Line 461 | public abstract class AbstractList<E> ex
461       * If this list implements {@code RandomAccess} the returned list will
462       * be an instance of the subclass that implements {@code RandomAccess}.
463       *
464 <     * <p>The subclass's {@code set(int, Object)}, {@code get(int)},
465 <     * {@code add(int, Object)}, {@code remove(int)}, {@code addAll(int,
464 >     * <p>The subclass's {@code set(int, E)}, {@code get(int)},
465 >     * {@code add(int, E)}, {@code remove(int)}, {@code addAll(int,
466       * Collection)} and {@code removeRange(int, int)} methods all
467       * delegate to the corresponding methods on the backing abstract list,
468       * after bounds-checking the index and adjusting for the offset.  The
# Line 463 | Line 480 | public abstract class AbstractList<E> ex
480       * {@code ConcurrentModificationException} if it is not.
481       *
482       * @throws IndexOutOfBoundsException endpoint index value out of range
483 <     *         {@code (fromIndex &lt; 0 || toIndex &gt; size)}
483 >     *         {@code (fromIndex < 0 || toIndex > size)}
484       * @throws IllegalArgumentException if the endpoint indices are out of order
485 <     *         {@code (fromIndex &gt; toIndex)}
485 >     *         {@code (fromIndex > toIndex)}
486       */
487      public List<E> subList(int fromIndex, int toIndex) {
488          return (this instanceof RandomAccess ?
# Line 580 | Line 597 | public abstract class AbstractList<E> ex
597       *
598       * <p><b>Use of this field by subclasses is optional.</b> If a subclass
599       * wishes to provide fail-fast iterators (and list iterators), then it
600 <     * merely has to increment this field in its {@code add(int, Object)} and
600 >     * merely has to increment this field in its {@code add(int, E)} and
601       * {@code remove(int)} methods (and any other methods that it overrides
602       * that result in structural modifications to the list).  A single call to
603 <     * {@code add(int, Object)} or {@code remove(int)} must add no more than
603 >     * {@code add(int, E)} or {@code remove(int)} must add no more than
604       * one to this field, or the iterators (and list iterators) will throw
605       * bogus {@code ConcurrentModificationExceptions}.  If an implementation
606       * does not wish to provide fail-fast iterators, this field may be
# Line 870 | Line 887 | class RandomAccessSubList<E> extends Sub
887                                         fromIndex, toIndex);
888      }
889   }
873

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines