equal
deleted
inserted
replaced
1002 } |
1002 } |
1003 |
1003 |
1004 /** |
1004 /** |
1005 * Returns an iterator over the elements in this deque in proper sequence. |
1005 * Returns an iterator over the elements in this deque in proper sequence. |
1006 * The elements will be returned in order from first (head) to last (tail). |
1006 * The elements will be returned in order from first (head) to last (tail). |
1007 * The returned {@code Iterator} is a "weakly consistent" iterator that |
1007 * |
|
1008 * <p>The returned iterator is a "weakly consistent" iterator that |
1008 * will never throw {@link java.util.ConcurrentModificationException |
1009 * will never throw {@link java.util.ConcurrentModificationException |
1009 * ConcurrentModificationException}, |
1010 * ConcurrentModificationException}, and guarantees to traverse |
1010 * and guarantees to traverse elements as they existed upon |
1011 * elements as they existed upon construction of the iterator, and |
1011 * construction of the iterator, and may (but is not guaranteed to) |
1012 * may (but is not guaranteed to) reflect any modifications |
1012 * reflect any modifications subsequent to construction. |
1013 * subsequent to construction. |
1013 * |
1014 * |
1014 * @return an iterator over the elements in this deque in proper sequence |
1015 * @return an iterator over the elements in this deque in proper sequence |
1015 */ |
1016 */ |
1016 public Iterator<E> iterator() { |
1017 public Iterator<E> iterator() { |
1017 return new Itr(); |
1018 return new Itr(); |
1019 |
1020 |
1020 /** |
1021 /** |
1021 * Returns an iterator over the elements in this deque in reverse |
1022 * Returns an iterator over the elements in this deque in reverse |
1022 * sequential order. The elements will be returned in order from |
1023 * sequential order. The elements will be returned in order from |
1023 * last (tail) to first (head). |
1024 * last (tail) to first (head). |
1024 * The returned {@code Iterator} is a "weakly consistent" iterator that |
1025 * |
|
1026 * <p>The returned iterator is a "weakly consistent" iterator that |
1025 * will never throw {@link java.util.ConcurrentModificationException |
1027 * will never throw {@link java.util.ConcurrentModificationException |
1026 * ConcurrentModificationException}, |
1028 * ConcurrentModificationException}, and guarantees to traverse |
1027 * and guarantees to traverse elements as they existed upon |
1029 * elements as they existed upon construction of the iterator, and |
1028 * construction of the iterator, and may (but is not guaranteed to) |
1030 * may (but is not guaranteed to) reflect any modifications |
1029 * reflect any modifications subsequent to construction. |
1031 * subsequent to construction. |
1030 */ |
1032 */ |
1031 public Iterator<E> descendingIterator() { |
1033 public Iterator<E> descendingIterator() { |
1032 return new DescendingItr(); |
1034 return new DescendingItr(); |
1033 } |
1035 } |
1034 |
1036 |