Class ObjectIterators.UnmodifiableBidirectionalIterator<K>

java.lang.Object
it.unimi.dsi.fastutil.objects.ObjectIterators.UnmodifiableBidirectionalIterator<K>
All Implemented Interfaces:
BidirectionalIterator<K>, ObjectBidirectionalIterator<K>, ObjectIterator<K>, java.util.Iterator<K>
Enclosing class:
ObjectIterators

public static class ObjectIterators.UnmodifiableBidirectionalIterator<K>
extends java.lang.Object
implements ObjectBidirectionalIterator<K>
An unmodifiable wrapper class for bidirectional iterators.
  • Constructor Summary

    Constructors
    Constructor Description
    UnmodifiableBidirectionalIterator​(ObjectBidirectionalIterator<? extends K> i)  
  • Method Summary

    Modifier and Type Method Description
    void forEachRemaining​(java.util.function.Consumer<? super K> action)  
    boolean hasNext()  
    boolean hasPrevious()
    Returns whether there is a previous element.
    K next()  
    K previous()
    Returns the previous element from the collection.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.Iterator

    remove

    Methods inherited from interface it.unimi.dsi.fastutil.objects.ObjectBidirectionalIterator

    back, skip
  • Constructor Details

  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface java.util.Iterator<K>
    • hasPrevious

      public boolean hasPrevious()
      Description copied from interface: BidirectionalIterator
      Returns whether there is a previous element.
      Specified by:
      hasPrevious in interface BidirectionalIterator<K>
      Returns:
      whether there is a previous element.
      See Also:
      ListIterator.hasPrevious()
    • next

      public K next()
      Specified by:
      next in interface java.util.Iterator<K>
    • previous

      public K previous()
      Description copied from interface: BidirectionalIterator
      Returns the previous element from the collection.
      Specified by:
      previous in interface BidirectionalIterator<K>
      Returns:
      the previous element from the collection.
      See Also:
      ListIterator.previous()
    • forEachRemaining

      public void forEachRemaining​(java.util.function.Consumer<? super K> action)
      Specified by:
      forEachRemaining in interface java.util.Iterator<K>