Class EliasFanoIndexedMonotoneLongBigList.EliasFanoIndexedMonotoneLongBigListIterator
java.lang.Object
it.unimi.dsi.sux4j.util.EliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator
it.unimi.dsi.sux4j.util.EliasFanoIndexedMonotoneLongBigList.EliasFanoIndexedMonotoneLongBigListIterator
- All Implemented Interfaces:
it.unimi.dsi.fastutil.BidirectionalIterator<Long>, it.unimi.dsi.fastutil.BigListIterator<Long>, it.unimi.dsi.fastutil.longs.LongBidirectionalIterator, it.unimi.dsi.fastutil.longs.LongBigListIterator, it.unimi.dsi.fastutil.longs.LongIterator, it.unimi.dsi.fastutil.objects.ObjectBidirectionalIterator<Long>, it.unimi.dsi.fastutil.objects.ObjectIterator<Long>, Iterator<Long>, PrimitiveIterator<Long, LongConsumer>, PrimitiveIterator.OfLong
- Enclosing class:
EliasFanoIndexedMonotoneLongBigList
public final class EliasFanoIndexedMonotoneLongBigList.EliasFanoIndexedMonotoneLongBigListIterator
extends EliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator
An list iterator over the values of this
EliasFanoIndexedMonotoneLongBigList
Besides the features of an
EliasFanoMonotoneLongBigListIterator, instance of this class provide a skipTo(long)
method that implements the same fast logic of
EliasFanoIndexedMonotoneLongBigList.successor(long).
-
Nested Class Summary
Nested classes/interfaces inherited from interface PrimitiveIterator
PrimitiveIterator.OfDouble, PrimitiveIterator.OfInt, PrimitiveIterator.OfLong -
Field Summary
FieldsFields inherited from class EliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator
index, lowerBitsPosition, window, word -
Method Summary
Modifier and TypeMethodDescriptionlongnextLong()longReturns the same element asEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator.nextLong(), ifEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator.hasNext()is true; otherwise, behavior is undefined.longlongReturns the same element asEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator.previousLong(), ifEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator.hasPrevious()is true; otherwise, behavior is undefined.longskipTo(long lowerBound) Moves this iterator to the first element greater than or equal to the provided bound.longskipToUnsafe(long lowerBound) Moves this iterator to the first element greater than or equal to the provided bound without checking its argument.Methods inherited from class EliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator
hasNext, hasPrevious, nextIndex, previousIndexMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface it.unimi.dsi.fastutil.longs.LongBidirectionalIterator
back, previousMethods inherited from interface it.unimi.dsi.fastutil.longs.LongBigListIterator
add, add, back, set, set, skip, skipMethods inherited from interface it.unimi.dsi.fastutil.longs.LongIterator
forEachRemaining, forEachRemaining, nextMethods inherited from interface PrimitiveIterator.OfLong
forEachRemaining
-
Field Details
-
last
protected long lastThe last returned value.
-
-
Method Details
-
nextLong
public long nextLong()- Specified by:
nextLongin interfaceit.unimi.dsi.fastutil.longs.LongIterator- Specified by:
nextLongin interfacePrimitiveIterator.OfLong- Overrides:
nextLongin classEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator
-
nextLongUnsafe
public long nextLongUnsafe()Description copied from class:EliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIteratorReturns the same element asEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator.nextLong(), ifEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator.hasNext()is true; otherwise, behavior is undefined.- Overrides:
nextLongUnsafein classEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator- Returns:
- the same element as
EliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator.nextLong(), ifEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator.hasNext()is true; otherwise, behavior is undefined.
-
previousLong
public long previousLong()- Specified by:
previousLongin interfaceit.unimi.dsi.fastutil.longs.LongBidirectionalIterator- Overrides:
previousLongin classEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator
-
previousLongUnsafe
public long previousLongUnsafe()Description copied from class:EliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIteratorReturns the same element asEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator.previousLong(), ifEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator.hasPrevious()is true; otherwise, behavior is undefined.- Overrides:
previousLongUnsafein classEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator- Returns:
- the same element as
EliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator.previousLong(), ifEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator.hasPrevious()is true; otherwise, behavior is undefined.
-
skipTo
public long skipTo(long lowerBound) Moves this iterator to the first element greater than or equal to the provided bound.- Parameters:
lowerBound- a nonnegative lower bound.- Returns:
- the last element returned by
nextLong()orpreviousLong()if it is smaller than or equal tolowerBound, in which case this method is a no-op. Otherwise, the first element among the ones that will be returned bynextLong()that is greater than or equal tolowerBound. The iterator will be positioned on the element (i.e., the next call tonextLong()will return the element). In particular,EliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator.nextIndex()returns the index of the returned element in the list. If no such element exists, this methods returnsLong.MAX_VALUEand sets the current index to the list length. - See Also:
-
skipToUnsafe
public long skipToUnsafe(long lowerBound) Moves this iterator to the first element greater than or equal to the provided bound without checking its argument.This method is slightly faster than
skipTo(long)as it does not check its argument.- Parameters:
lowerBound- a nonnegative lower bound smaller than or equal to the last element of the sequence plus one.- Returns:
- the last element returned by
nextLong()orpreviousLong()if it is smaller than or equal tolowerBound, in which case this method is a no-op. Otherwise, the first element among the ones that will be returned bynextLong()that is greater than or equal tolowerBound. The iterator will be positioned on the element (i.e., the next call tonextLong()will return the element). In particular,EliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator.nextIndex()returns the index of the returned element in the list. If no such element exists, this methods returns the last element of this list plus one and sets the current index to the list length. Behavior is undefined iflowerBoundis out of bounds. - See Also:
-