Package it.unimi.dsi.fastutil.shorts
Interface ShortBidirectionalIterator
- All Superinterfaces:
BidirectionalIterator<Short>
,Iterator<Short>
,ObjectBidirectionalIterator<Short>
,ObjectIterator<Short>
,PrimitiveIterator<Short,
,ShortConsumer> ShortIterator
- All Known Subinterfaces:
ShortBigListIterator
,ShortListIterator
- All Known Implementing Classes:
AbstractShortBidirectionalIterator
,AbstractShortBigListIterator
,AbstractShortListIterator
,ShortBigListIterators.AbstractIndexBasedBigListIterator
,ShortBigListIterators.BigListIteratorListIterator
,ShortBigListIterators.EmptyBigListIterator
,ShortBigListIterators.UnmodifiableBigListIterator
,ShortIterators.AbstractIndexBasedListIterator
,ShortIterators.EmptyIterator
,ShortIterators.UnmodifiableBidirectionalIterator
,ShortIterators.UnmodifiableListIterator
public interface ShortBidirectionalIterator
extends ShortIterator, ObjectBidirectionalIterator<Short>
A type-specific bidirectional iterator; provides an additional method to avoid (un)boxing, and
the possibility to skip elements backwards.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.PrimitiveIterator
PrimitiveIterator.OfDouble, PrimitiveIterator.OfInt, PrimitiveIterator.OfLong
-
Method Summary
Modifier and TypeMethodDescriptiondefault int
back
(int n) Moves back for the given number of elements.default Short
previous()
Deprecated.Please use the corresponding type-specific method instead.short
Returns the previous element as a primitive type.default int
skip
(int n) Skips the given number of elements.Methods inherited from interface it.unimi.dsi.fastutil.BidirectionalIterator
hasPrevious
Methods inherited from interface it.unimi.dsi.fastutil.shorts.ShortIterator
forEachRemaining, forEachRemaining, forEachRemaining, next, nextShort
-
Method Details
-
previousShort
short previousShort()Returns the previous element as a primitive type.- Returns:
- the previous element in the iteration.
- See Also:
-
previous
Deprecated.Please use the corresponding type-specific method instead.Returns the previous element from the collection.- Specified by:
previous
in interfaceBidirectionalIterator<Short>
- Returns:
- the previous element from the collection.
- See Also:
-
back
default int back(int n) Moves back for the given number of elements.The effect of this call is exactly the same as that of calling
previous()
forn
times (possibly stopping ifBidirectionalIterator.hasPrevious()
becomes false).- Specified by:
back
in interfaceObjectBidirectionalIterator<Short>
- Parameters:
n
- the number of elements to skip back.- Returns:
- the number of elements actually skipped.
- See Also:
-
skip
default int skip(int n) Skips the given number of elements.The effect of this call is exactly the same as that of calling
ShortIterator.next()
forn
times (possibly stopping ifIterator.hasNext()
becomes false).- Specified by:
skip
in interfaceObjectBidirectionalIterator<Short>
- Specified by:
skip
in interfaceObjectIterator<Short>
- Specified by:
skip
in interfaceShortIterator
- Parameters:
n
- the number of elements to skip.- Returns:
- the number of elements actually skipped.
- See Also:
-