--- jsr166/src/main/java/util/LinkedList.java 2005/05/21 17:33:09 1.33 +++ jsr166/src/main/java/util/LinkedList.java 2007/05/20 07:54:01 1.47 @@ -1,8 +1,26 @@ /* - * %W% %E% + * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. - * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. */ package java.util; @@ -25,18 +43,20 @@ package java.util; * list. Operations that index into the list will traverse the list from * the beginning or the end, whichever is closer to the specified index.
* - * Note that this implementation is not synchronized. If multiple - * threads access a list concurrently, and at least one of the threads - * modifies the list structurally, it must be synchronized - * externally. (A structural modification is any operation that adds or - * deletes one or more elements; merely setting the value of an element is not - * a structural modification.) This is typically accomplished by - * synchronizing on some object that naturally encapsulates the list. If no - * such object exists, the list should be "wrapped" using the - * Collections.synchronizedList method. This is best done at creation time, - * to prevent accidental unsynchronized access to the list:
- * List list = Collections.synchronizedList(new LinkedList(...)); - *+ *
Note that this implementation is not synchronized. + * If multiple threads access a linked list concurrently, and at least + * one of the threads modifies the list structurally, it must be + * synchronized externally. (A structural modification is any operation + * that adds or deletes one or more elements; merely setting the value of + * an element is not a structural modification.) This is typically + * accomplished by synchronizing on some object that naturally + * encapsulates the list. + * + * If no such object exists, the list should be "wrapped" using the + * {@link Collections#synchronizedList Collections.synchronizedList} + * method. This is best done at creation time, to prevent accidental + * unsynchronized access to the list:
+ * List list = Collections.synchronizedList(new LinkedList(...));* *
The iterators returned by this class's iterator and * listIterator methods are fail-fast: if the list is @@ -57,7 +77,7 @@ package java.util; * should be used only to detect bugs. * *
This class is a member of the
- *
+ *
* Java Collections Framework.
*
* @author Josh Bloch
@@ -65,7 +85,6 @@ package java.util;
* @see List
* @see ArrayList
* @see Vector
- * @see Collections#synchronizedList(List)
* @since 1.2
* @param This method is equivalent to {@link #add}.
+ *
+ * @param e the element to add
*/
public void addLast(E e) {
addBefore(e, header);
@@ -187,8 +207,10 @@ public class LinkedList This method is equivalent to {@link #addLast}.
+ *
* @param e element to be appended to this list
- * @return true (as per the spec for {@link Collection#add})
+ * @return true (as specified by {@link Collection#add})
*/
public boolean add(E e) {
addBefore(e, header);
@@ -481,7 +503,7 @@ public class LinkedList