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.39 by jsr166, Thu Aug 11 08:53:47 2005 UTC vs.
Revision 1.41 by jsr166, Fri Sep 16 04:24:44 2005 UTC

# Line 798 | Line 798 | public class LinkedList<E>
798          return result;
799      }
800  
801 +    public Iterator<E> descendingIterator() {
802 +        return new DescendingIterator();
803 +    }
804 +
805 +    /** Adapter to provide descending iterators via ListItr.previous */
806 +    private class DescendingIterator implements Iterator {
807 +        final ListItr itr = new ListItr(size());
808 +        public boolean hasNext() {
809 +            return itr.hasPrevious();
810 +        }
811 +        public E next() {
812 +            return itr.previous();
813 +        }
814 +        public void remove() {
815 +            itr.remove();
816 +        }
817 +    }
818 +
819      /**
820       * Returns a shallow copy of this <tt>LinkedList</tt>. (The elements
821       * themselves are not cloned.)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines