1 |
|
/* |
2 |
< |
* %W% %E% |
2 |
> |
* Copyright 1994-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; |
581 |
|
* increased if its size becomes greater than its capacity. |
582 |
|
* |
583 |
|
* <p>This method is identical in functionality to the |
584 |
< |
* {@link #remove(Object)} method (which is part of the |
585 |
< |
* {@link List} interface). |
584 |
> |
* {@link #add(Object) add(E)} |
585 |
> |
* method (which is part of the {@link List} interface). |
586 |
|
* |
587 |
|
* @param obj the component to be added |
588 |
|
*/ |
599 |
|
* object's index is shifted downward to have an index one smaller |
600 |
|
* than the value it had previously. |
601 |
|
* |
602 |
< |
* <p>This method is identical in functionality to the remove(Object) |
603 |
< |
* method (which is part of the List interface). |
602 |
> |
* <p>This method is identical in functionality to the |
603 |
> |
* {@link #remove(Object)} method (which is part of the |
604 |
> |
* {@link List} interface). |
605 |
|
* |
606 |
|
* @param obj the component to be removed |
607 |
|
* @return {@code true} if the argument was a component of this |
608 |
|
* vector; {@code false} otherwise. |
590 |
– |
* @see List#remove(Object) |
591 |
– |
* @see List |
609 |
|
*/ |
610 |
|
public synchronized boolean removeElement(Object obj) { |
611 |
|
modCount++; |
783 |
|
* Shifts any subsequent elements to the left (subtracts one from their |
784 |
|
* indices). Returns the element that was removed from the Vector. |
785 |
|
* |
786 |
< |
* @exception ArrayIndexOutOfBoundsException index out of range (index |
787 |
< |
* < 0 || index >= size()) |
786 |
> |
* @throws ArrayIndexOutOfBoundsException if the index is out of range |
787 |
> |
* ({@code index < 0 || index >= size()}) |
788 |
|
* @param index the index of the element to be removed |
789 |
|
* @return element that was removed |
790 |
|
* @since 1.2 |
903 |
|
* specified collection |
904 |
|
* @param c elements to be inserted into this Vector |
905 |
|
* @return {@code true} if this Vector changed as a result of the call |
906 |
< |
* @exception ArrayIndexOutOfBoundsException index out of range (index |
907 |
< |
* < 0 || index > size()) |
906 |
> |
* @throws ArrayIndexOutOfBoundsException if the index is out of range |
907 |
> |
* ({@code index < 0 || index > size()}) |
908 |
|
* @throws NullPointerException if the specified collection is null |
909 |
|
* @since 1.2 |
910 |
|
*/ |
1051 |
|
|
1052 |
|
/** |
1053 |
|
* Streamlined specialization of AbstractList version of iterator. |
1054 |
< |
* Locally perfroms bounds checks, but relies on outer Vector |
1054 |
> |
* Locally performs bounds checks, but relies on outer Vector |
1055 |
|
* to access elements under synchronization. |
1056 |
|
*/ |
1057 |
|
private final class VectorIterator implements ListIterator<E> { |
1179 |
|
* @param fromIndex low endpoint (inclusive) of the subList |
1180 |
|
* @param toIndex high endpoint (exclusive) of the subList |
1181 |
|
* @return a view of the specified range within this List |
1182 |
< |
* @throws IndexOutOfBoundsException endpoint index value out of range |
1183 |
< |
* <code>(fromIndex < 0 || toIndex > size)</code> |
1184 |
< |
* @throws IllegalArgumentException endpoint indices out of order |
1185 |
< |
* <code>(fromIndex > toIndex)</code> |
1182 |
> |
* @throws IndexOutOfBoundsException if an endpoint index value is out of range |
1183 |
> |
* {@code (fromIndex < 0 || toIndex > size)} |
1184 |
> |
* @throws IllegalArgumentException if the endpoint indices are out of order |
1185 |
> |
* {@code (fromIndex > toIndex)} |
1186 |
|
*/ |
1187 |
|
public synchronized List<E> subList(int fromIndex, int toIndex) { |
1188 |
|
return new VectorSubList(this, this, fromIndex, fromIndex, toIndex); |