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.38 by jsr166, Mon Jul 18 19:14:17 2005 UTC vs.
Revision 1.43 by jsr166, Tue Jan 10 21:32:09 2006 UTC

# Line 1 | Line 1
1   /*
2   * %W% %E%
3   *
4 < * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
4 > * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
5   * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6   */
7  
# Line 510 | Line 510 | public class LinkedList<E>
510       * Inserts the specified element at the end of this list.
511       *
512       * @param e the element to insert
513 <     * @return <tt>true</tt> (as per the spec for {@link Deque#offerLast})
513 >     * @return <tt>true</tt> (as specified by {@link Deque#offerLast})
514       * @since 1.6
515       */
516      public boolean offerLast(E e) {
# Line 547 | Line 547 | public class LinkedList<E>
547      }
548  
549      /**
550 <     * Retrieves and removes the first element of this list, or
551 <     * <tt>null</tt> if this list is empty.
550 >     * Retrieves and removes the first element of this list,
551 >     * or returns <tt>null</tt> if this list is empty.
552       *
553       * @return the first element of this list, or <tt>null</tt> if
554       *     this list is empty
# Line 561 | Line 561 | public class LinkedList<E>
561      }
562  
563      /**
564 <     * Retrieves and removes the last element of this list, or
565 <     * <tt>null</tt> if this list is empty.
564 >     * Retrieves and removes the last element of this list,
565 >     * or returns <tt>null</tt> if this list is empty.
566       *
567       * @return the last element of this list, or <tt>null</tt> if
568       *     this list is empty
# Line 799 | Line 799 | public class LinkedList<E>
799      }
800  
801      /**
802 +     * @since 1.6
803 +     */
804 +    public Iterator<E> descendingIterator() {
805 +        return new DescendingIterator();
806 +    }
807 +
808 +    /** Adapter to provide descending iterators via ListItr.previous */
809 +    private class DescendingIterator implements Iterator {
810 +        final ListItr itr = new ListItr(size());
811 +        public boolean hasNext() {
812 +            return itr.hasPrevious();
813 +        }
814 +        public E next() {
815 +            return itr.previous();
816 +        }
817 +        public void remove() {
818 +            itr.remove();
819 +        }
820 +    }
821 +
822 +    /**
823       * Returns a shallow copy of this <tt>LinkedList</tt>. (The elements
824       * themselves are not cloned.)
825       *

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines