it.unimi.dsi.fastutil.longs
Interface LongBidirectionalIterator

All Superinterfaces:
BidirectionalIterator<java.lang.Long>, java.util.Iterator<java.lang.Long>, LongIterator, ObjectBidirectionalIterator<java.lang.Long>, ObjectIterator<java.lang.Long>
All Known Subinterfaces:
LongBigListIterator, LongListIterator
All Known Implementing Classes:
AbstractLongBidirectionalIterator, AbstractLongBigListIterator, AbstractLongListIterator, LongBigListIterators.BigListIteratorListIterator, LongBigListIterators.EmptyBigListIterator, LongBigListIterators.UnmodifiableBigListIterator, LongIterators.EmptyIterator, LongIterators.UnmodifiableBidirectionalIterator, LongIterators.UnmodifiableListIterator

public interface LongBidirectionalIterator
extends LongIterator, ObjectBidirectionalIterator<java.lang.Long>

A type-specific bidirectional iterator; provides an additional method to avoid (un)boxing, and the possibility to skip elements backwards.

See Also:
BidirectionalIterator

Method Summary
 int back(int n)
          Moves back for the given number of elements.
 long previousLong()
          Returns the previous element as a primitive type.
 
Methods inherited from interface it.unimi.dsi.fastutil.longs.LongIterator
nextLong, skip
 
Methods inherited from interface it.unimi.dsi.fastutil.objects.ObjectIterator
skip
 
Methods inherited from interface it.unimi.dsi.fastutil.BidirectionalIterator
hasPrevious, previous
 
Methods inherited from interface java.util.Iterator
hasNext, next, remove
 

Method Detail

previousLong

long previousLong()
Returns the previous element as a primitive type.

Returns:
the previous element in the iteration.
See Also:
ListIterator.previous()

back

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 BidirectionalIterator.previous() for n times (possibly stopping if BidirectionalIterator.hasPrevious() becomes false).

Specified by:
back in interface ObjectBidirectionalIterator<java.lang.Long>
Parameters:
n - the number of elements to skip back.
Returns:
the number of elements actually skipped.
See Also:
Iterator.next()