Interface BidirectionalIterator<K>

All Superinterfaces:
java.util.Iterator<K>
All Known Subinterfaces:
BigListIterator<K>, BooleanBidirectionalIterator, BooleanBigListIterator, BooleanListIterator, ByteBidirectionalIterator, ByteBigListIterator, ByteListIterator, CharBidirectionalIterator, CharBigListIterator, CharListIterator, DoubleBidirectionalIterator, DoubleBigListIterator, DoubleListIterator, FloatBidirectionalIterator, FloatBigListIterator, FloatListIterator, IntBidirectionalIterator, IntBigListIterator, IntListIterator, LongBidirectionalIterator, LongBigListIterator, LongListIterator, ObjectBidirectionalIterator<K>, ObjectBigListIterator<K>, ObjectListIterator<K>, ShortBidirectionalIterator, ShortBigListIterator, ShortListIterator
All Known Implementing Classes:
AbstractBooleanBidirectionalIterator, AbstractBooleanBigListIterator, AbstractBooleanListIterator, AbstractByteBidirectionalIterator, AbstractByteBigListIterator, AbstractByteListIterator, AbstractCharBidirectionalIterator, AbstractCharBigListIterator, AbstractCharListIterator, AbstractDoubleBidirectionalIterator, AbstractDoubleBigListIterator, AbstractDoubleListIterator, AbstractFloatBidirectionalIterator, AbstractFloatBigListIterator, AbstractFloatListIterator, AbstractIntBidirectionalIterator, AbstractIntBigListIterator, AbstractIntListIterator, AbstractLongBidirectionalIterator, AbstractLongBigListIterator, AbstractLongListIterator, AbstractObjectBidirectionalIterator, AbstractObjectBigListIterator, AbstractObjectListIterator, AbstractShortBidirectionalIterator, AbstractShortBigListIterator, AbstractShortListIterator, BooleanBigListIterators.AbstractIndexBasedBigListIterator, BooleanBigListIterators.BigListIteratorListIterator, BooleanBigListIterators.EmptyBigListIterator, BooleanBigListIterators.UnmodifiableBigListIterator, BooleanIterators.AbstractIndexBasedListIterator, BooleanIterators.EmptyIterator, BooleanIterators.UnmodifiableBidirectionalIterator, BooleanIterators.UnmodifiableListIterator, ByteBigListIterators.AbstractIndexBasedBigListIterator, ByteBigListIterators.BigListIteratorListIterator, ByteBigListIterators.EmptyBigListIterator, ByteBigListIterators.UnmodifiableBigListIterator, ByteIterators.AbstractIndexBasedListIterator, ByteIterators.EmptyIterator, ByteIterators.UnmodifiableBidirectionalIterator, ByteIterators.UnmodifiableListIterator, CharBigListIterators.AbstractIndexBasedBigListIterator, CharBigListIterators.BigListIteratorListIterator, CharBigListIterators.EmptyBigListIterator, CharBigListIterators.UnmodifiableBigListIterator, CharIterators.AbstractIndexBasedListIterator, CharIterators.EmptyIterator, CharIterators.UnmodifiableBidirectionalIterator, CharIterators.UnmodifiableListIterator, DoubleBigListIterators.AbstractIndexBasedBigListIterator, DoubleBigListIterators.BigListIteratorListIterator, DoubleBigListIterators.EmptyBigListIterator, DoubleBigListIterators.UnmodifiableBigListIterator, DoubleIterators.AbstractIndexBasedListIterator, DoubleIterators.EmptyIterator, DoubleIterators.UnmodifiableBidirectionalIterator, DoubleIterators.UnmodifiableListIterator, FloatBigListIterators.AbstractIndexBasedBigListIterator, FloatBigListIterators.BigListIteratorListIterator, FloatBigListIterators.EmptyBigListIterator, FloatBigListIterators.UnmodifiableBigListIterator, FloatIterators.AbstractIndexBasedListIterator, FloatIterators.EmptyIterator, FloatIterators.UnmodifiableBidirectionalIterator, FloatIterators.UnmodifiableListIterator, IntBigListIterators.AbstractIndexBasedBigListIterator, IntBigListIterators.BigListIteratorListIterator, IntBigListIterators.EmptyBigListIterator, IntBigListIterators.UnmodifiableBigListIterator, IntIterators.AbstractIndexBasedListIterator, IntIterators.EmptyIterator, IntIterators.UnmodifiableBidirectionalIterator, IntIterators.UnmodifiableListIterator, LongBigListIterators.AbstractIndexBasedBigListIterator, LongBigListIterators.BigListIteratorListIterator, LongBigListIterators.EmptyBigListIterator, LongBigListIterators.UnmodifiableBigListIterator, LongIterators.AbstractIndexBasedListIterator, LongIterators.EmptyIterator, LongIterators.UnmodifiableBidirectionalIterator, LongIterators.UnmodifiableListIterator, ObjectBigListIterators.AbstractIndexBasedBigListIterator, ObjectBigListIterators.BigListIteratorListIterator, ObjectBigListIterators.EmptyBigListIterator, ObjectBigListIterators.UnmodifiableBigListIterator, ObjectIterators.AbstractIndexBasedListIterator, ObjectIterators.EmptyIterator, ObjectIterators.UnmodifiableBidirectionalIterator, ObjectIterators.UnmodifiableListIterator, ShortBigListIterators.AbstractIndexBasedBigListIterator, ShortBigListIterators.BigListIteratorListIterator, ShortBigListIterators.EmptyBigListIterator, ShortBigListIterators.UnmodifiableBigListIterator, ShortIterators.AbstractIndexBasedListIterator, ShortIterators.EmptyIterator, ShortIterators.UnmodifiableBidirectionalIterator, ShortIterators.UnmodifiableListIterator

public interface BidirectionalIterator<K>
extends java.util.Iterator<K>
A bidirectional Iterator.

This kind of iterator is essentially a ListIterator that does not support ListIterator.previousIndex() and ListIterator.nextIndex(). It is useful for those maps that can easily provide bidirectional iteration, but provide no index.

Note that iterators returned by fastutil classes are more specific, and support skipping. This class serves the purpose of organising in a cleaner way the relationships between various iterators.

See Also:
Iterator, ListIterator
  • Method Summary

    Modifier and Type Method Description
    boolean hasPrevious()
    Returns whether there is a previous element.
    K previous()
    Returns the previous element from the collection.

    Methods inherited from interface java.util.Iterator

    forEachRemaining, hasNext, next, remove
  • Method Details

    • previous

      K previous()
      Returns the previous element from the collection.
      Returns:
      the previous element from the collection.
      See Also:
      ListIterator.previous()
    • hasPrevious

      boolean hasPrevious()
      Returns whether there is a previous element.
      Returns:
      whether there is a previous element.
      See Also:
      ListIterator.hasPrevious()