Class TreeBidiMap.ViewIterator

java.lang.Object
org.apache.commons.collections.bidimap.TreeBidiMap.ViewIterator
All Implemented Interfaces:
Iterator, OrderedIterator
Direct Known Subclasses:
TreeBidiMap.ViewMapIterator
Enclosing class:
TreeBidiMap

static class TreeBidiMap.ViewIterator extends Object implements OrderedIterator
An iterator over the map.
  • Field Details

    • main

      protected final TreeBidiMap main
      The parent map.
    • orderType

      protected final int orderType
      Whether to return KEY or VALUE order.
    • dataType

      protected final int dataType
      Whether to return KEY, VALUE, MAPENTRY or INVERSEMAPENTRY data.
    • lastReturnedNode

      protected TreeBidiMap.Node lastReturnedNode
      The last node returned by the iterator.
    • nextNode

      protected TreeBidiMap.Node nextNode
      The next node to be returned by the iterator.
    • previousNode

      protected TreeBidiMap.Node previousNode
      The previous node in the sequence returned by the iterator.
    • expectedModifications

      private int expectedModifications
      The modification count.
  • Constructor Details

    • ViewIterator

      ViewIterator(TreeBidiMap main, int orderType, int dataType)
      Constructor.
      Parameters:
      main - the main map
      orderType - the KEY or VALUE int for the order
      dataType - the KEY, VALUE, MAPENTRY or INVERSEMAPENTRY int
  • Method Details

    • hasNext

      public final boolean hasNext()
      Specified by:
      hasNext in interface Iterator
    • next

      public final Object next()
      Specified by:
      next in interface Iterator
    • hasPrevious

      public boolean hasPrevious()
      Description copied from interface: OrderedIterator
      Checks to see if there is a previous element that can be iterated to.
      Specified by:
      hasPrevious in interface OrderedIterator
      Returns:
      true if the iterator has a previous element
    • previous

      public Object previous()
      Description copied from interface: OrderedIterator
      Gets the previous element from the collection.
      Specified by:
      previous in interface OrderedIterator
      Returns:
      the previous element in the iteration
    • doGetData

      protected Object doGetData()
      Gets the data value for the lastReturnedNode field.
      Returns:
      the data value
    • remove

      public final void remove()
      Specified by:
      remove in interface Iterator