Package it.unimi.dsi.sux4j.util
Class MappedEliasFanoMonotoneLongBigList.MappedEliasFanoMonotoneLongBigListIterator
java.lang.Object
it.unimi.dsi.sux4j.util.MappedEliasFanoMonotoneLongBigList.MappedEliasFanoMonotoneLongBigListIterator
- All Implemented Interfaces:
BidirectionalIterator<Long>
,BigListIterator<Long>
,LongBidirectionalIterator
,LongBigListIterator
,LongIterator
,ObjectBidirectionalIterator<Long>
,ObjectIterator<Long>
,Iterator<Long>
,PrimitiveIterator<Long,
,LongConsumer> PrimitiveIterator.OfLong
- Enclosing class:
- MappedEliasFanoMonotoneLongBigList
public class MappedEliasFanoMonotoneLongBigList.MappedEliasFanoMonotoneLongBigListIterator
extends Object
implements LongBigListIterator
A list iterator over the values of this
MappedEliasFanoMonotoneLongBigList
.
Forward iteration will be faster than iterated calls to
getLong()
. Backward iteration is available,
but it will perform similarly to getLong()
.
Additional unsafe methods nextLongUnsafe()
and previousLongUnsafe()
iterate without checking for the existence of a next element.
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.PrimitiveIterator
PrimitiveIterator.OfDouble, PrimitiveIterator.OfInt, PrimitiveIterator.OfLong
-
Field Summary
Modifier and TypeFieldDescriptionprotected long
The index of the next element to return.protected long
The current position in the array of lower bits.protected long
The current window.protected long
The current word in the array of upper bits. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
hasNext()
boolean
long
long
nextLong()
long
Returns the same element asnextLong()
, ifhasNext()
is true; otherwise, behavior is undefined.long
long
long
Returns the same element aspreviousLong()
, ifhasPrevious()
is true; otherwise, behavior is undefined.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface it.unimi.dsi.fastutil.longs.LongBidirectionalIterator
back, previous
Methods inherited from interface it.unimi.dsi.fastutil.longs.LongBigListIterator
add, add, back, set, set, skip, skip
Methods inherited from interface it.unimi.dsi.fastutil.longs.LongIterator
forEachRemaining, forEachRemaining, next
Methods inherited from interface java.util.PrimitiveIterator.OfLong
forEachRemaining
-
Field Details
-
index
protected long indexThe index of the next element to return. -
word
protected long wordThe current word in the array of upper bits. -
window
protected long windowThe current window. -
lowerBitsPosition
protected long lowerBitsPositionThe current position in the array of lower bits.
-
-
Constructor Details
-
MappedEliasFanoMonotoneLongBigListIterator
protected MappedEliasFanoMonotoneLongBigListIterator(long from)
-
-
Method Details
-
previousIndex
public long previousIndex()- Specified by:
previousIndex
in interfaceBigListIterator<Long>
-
nextIndex
public long nextIndex()- Specified by:
nextIndex
in interfaceBigListIterator<Long>
-
hasPrevious
public boolean hasPrevious()- Specified by:
hasPrevious
in interfaceBidirectionalIterator<Long>
-
hasNext
public boolean hasNext() -
nextLong
public long nextLong()- Specified by:
nextLong
in interfaceLongIterator
- Specified by:
nextLong
in interfacePrimitiveIterator.OfLong
-
nextLongUnsafe
public long nextLongUnsafe()Returns the same element asnextLong()
, ifhasNext()
is true; otherwise, behavior is undefined.- Returns:
- the same element as
nextLong()
, ifhasNext()
is true; otherwise, behavior is undefined.
-
previousLong
public long previousLong()- Specified by:
previousLong
in interfaceLongBidirectionalIterator
-
previousLongUnsafe
public long previousLongUnsafe()Returns the same element aspreviousLong()
, ifhasPrevious()
is true; otherwise, behavior is undefined.- Returns:
- the same element as
previousLong()
, ifhasPrevious()
is true; otherwise, behavior is undefined.
-