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 |
|
|
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 |
|
* |