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

Comparing jsr166/src/main/java/util/LinkedList.java (file contents):
Revision 1.5 by dl, Sun Aug 31 13:33:06 2003 UTC vs.
Revision 1.11 by jsr166, Tue Oct 21 05:11:40 2003 UTC

# Line 1 | Line 1
1   /*
2 < * @(#)LinkedList.java  1.53 03/06/22
2 > * %W% %E%
3   *
4   * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
5   * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
# Line 25 | Line 25 | package java.util;
25   *
26   * All of the operations perform as could be expected for a doubly-linked
27   * list.  Operations that index into the list will traverse the list from
28 < * the begining or the end, whichever is closer to the specified index.<p>
28 > * the beginning or the end, whichever is closer to the specified index.<p>
29   *
30   * <b>Note that this implementation is not synchronized.</b> If multiple
31   * threads access a list concurrently, and at least one of the threads
# Line 62 | Line 62 | package java.util;
62   * Java Collections Framework</a>.
63   *
64   * @author  Josh Bloch
65 < * @version 1.53, 06/22/03
65 > * @version %I%, %G%
66   * @see     List
67   * @see     ArrayList
68   * @see     Vector
69   * @see     Collections#synchronizedList(List)
70   * @since 1.2
71 + * @param <E> the type of elements held in this collection
72   */
73  
74   public class LinkedList<E>
# Line 442 | Line 443 | public class LinkedList<E>
443      // Queue operations.
444  
445      /**
446 <     * Retrieves, but does not remove, the head (first element) of this list..
446 >     * Retrieves, but does not remove, the head (first element) of this list.
447       * @return the head of this queue, or <tt>null</tt> if this queue is empty.
448 +     * @since 1.5
449       */
450      public E peek() {
451          if (size==0)
# Line 452 | Line 454 | public class LinkedList<E>
454      }
455  
456      /**
457 <     * Retrieves, but does not remove, the head (first element) of this list..
457 >     * Retrieves, but does not remove, the head (first element) of this list.
458       * @return the head of this queue.
459       * @throws NoSuchElementException if this queue is empty.
460 +     * @since 1.5
461       */
462      public E element() {
463          return getFirst();
464      }
465  
466      /**
467 <     * Retrieves and removes the head (first element) of this list..
467 >     * Retrieves and removes the head (first element) of this list.
468       * @return the head of this queue, or <tt>null</tt> if this queue is empty.
469 +     * @since 1.5
470       */
471      public E poll() {
472          if (size==0)
# Line 471 | Line 475 | public class LinkedList<E>
475      }
476  
477      /**
478 <     * Retrieves and removes the head (first element) of this list..
478 >     * Retrieves and removes the head (first element) of this list.
479       * @return the head of this queue.
480       * @throws NoSuchElementException if this queue is empty.
481 +     * @since 1.5
482       */
483      public E remove() {
484          return removeFirst();
# Line 482 | Line 487 | public class LinkedList<E>
487      /**
488       * Adds the specified element as the tail (last element) of this list.
489       *
490 <     * @param x the element to add.
490 >     * @param o the element to add.
491       * @return <tt>true</tt> (as per the general contract of
492       * <tt>Queue.offer</tt>)
493 +     * @since 1.5
494       */
495 <    public boolean offer(E x) {
496 <        return add(x);
495 >    public boolean offer(E o) {
496 >        return add(o);
497      }
498  
499      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines