Package it.unimi.dsi.fastutil.objects
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 voidforEachRemaining(java.util.function.Consumer<? super K> action)booleanhasNext()booleanhasPrevious()Returns whether there is a previous element.Knext()Kprevious()Returns the previous element from the collection.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
removeMethods inherited from interface it.unimi.dsi.fastutil.objects.ObjectBidirectionalIterator
back, skip
-
Constructor Details
-
UnmodifiableBidirectionalIterator
-
-
Method Details
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfacejava.util.Iterator<K>
-
hasPrevious
public boolean hasPrevious()Description copied from interface:BidirectionalIteratorReturns whether there is a previous element.- Specified by:
hasPreviousin interfaceBidirectionalIterator<K>- Returns:
- whether there is a previous element.
- See Also:
ListIterator.hasPrevious()
-
next
- Specified by:
nextin interfacejava.util.Iterator<K>
-
previous
Description copied from interface:BidirectionalIteratorReturns the previous element from the collection.- Specified by:
previousin interfaceBidirectionalIterator<K>- Returns:
- the previous element from the collection.
- See Also:
ListIterator.previous()
-
forEachRemaining
- Specified by:
forEachRemainingin interfacejava.util.Iterator<K>
-