org.apache.commons.collections4

## Interface OrderedIterator<E>

- Type Parameters:
    `E` - the type to iterate over
  All Superinterfaces:
    Iterator<E>
  All Known Subinterfaces:
    OrderedMapIterator<K,V>, ResettableListIterator<E>
  All Known Implementing Classes:
    AbstractLinkedList.LinkedListIterator, AbstractLinkedList.LinkedSubListIterator, AbstractLinkedMap.EntrySetIterator, AbstractLinkedMap.KeySetIterator, AbstractLinkedMap.LinkMapIterator, AbstractLinkedMap.ValuesIterator, AbstractOrderedMapIteratorDecorator, AbstractSortedMapDecorator.SortedMapIterator, ArrayListIterator, CursorableLinkedList.Cursor, CursorableLinkedList.SubCursor, DualTreeBidiMap.BidiOrderedMapIterator, EmptyListIterator, EmptyOrderedIterator, EmptyOrderedMapIterator, ListIteratorWrapper, LoopingListIterator, ObjectArrayListIterator, ReverseListIterator, SingletonListIterator, UnmodifiableOrderedMapIterator

      public interface OrderedIterator<E>
      extends Iterator<E>

  Defines an iterator that operates over an ordered container. Subset of `ListIterator`.

  This iterator allows both forward and reverse iteration through the container.

  Since:
    3.0
  Version:
    $Id: OrderedIterator.java 1469004 2013-04-17 17:37:03Z tn $

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `hasPrevious()` Checks to see if there is a previous element that can be iterated to.
    `E` | `previous()` Gets the previous element from the container.

    - ### Methods inherited from interface java.util.Iterator

      `hasNext, next, remove`

- - ### Method Detail

    - #### hasPrevious

          boolean hasPrevious()

      Checks to see if there is a previous element that can be iterated to.
      Returns:
        `true` if the iterator has a previous element

    - #### previous

          E previous()

      Gets the previous element from the container.
      Returns:
        the previous element in the iteration
      Throws:
        `NoSuchElementException` - if the iteration is finished

Copyright © 2001–2013 The Apache Software Foundation. All rights reserved.