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 |
|
|
8 |
|
package java.util; |
9 |
– |
import java.util.*; // for javadoc (till 6280605 is fixed) |
9 |
|
|
10 |
|
/** |
11 |
|
* Linked list implementation of the <tt>List</tt> interface. Implements all |
798 |
|
} |
799 |
|
|
800 |
|
/** |
801 |
+ |
* @since 1.6 |
802 |
+ |
*/ |
803 |
+ |
public Iterator<E> descendingIterator() { |
804 |
+ |
return new DescendingIterator(); |
805 |
+ |
} |
806 |
+ |
|
807 |
+ |
/** Adapter to provide descending iterators via ListItr.previous */ |
808 |
+ |
private class DescendingIterator implements Iterator { |
809 |
+ |
final ListItr itr = new ListItr(size()); |
810 |
+ |
public boolean hasNext() { |
811 |
+ |
return itr.hasPrevious(); |
812 |
+ |
} |
813 |
+ |
public E next() { |
814 |
+ |
return itr.previous(); |
815 |
+ |
} |
816 |
+ |
public void remove() { |
817 |
+ |
itr.remove(); |
818 |
+ |
} |
819 |
+ |
} |
820 |
+ |
|
821 |
+ |
/** |
822 |
|
* Returns a shallow copy of this <tt>LinkedList</tt>. (The elements |
823 |
|
* themselves are not cloned.) |
824 |
|
* |