Package it.unimi.dsi.sux4j.util
Class EliasFanoPrefixSumLongBigList.EliasFanoPrefixSumLongBigListIterator
java.lang.Object
it.unimi.dsi.sux4j.util.EliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator
it.unimi.dsi.sux4j.util.EliasFanoPrefixSumLongBigList.EliasFanoPrefixSumLongBigListIterator
- All Implemented Interfaces:
BidirectionalIterator<Long>
,BigListIterator<Long>
,LongBidirectionalIterator
,LongBigListIterator
,LongIterator
,ObjectBidirectionalIterator<Long>
,ObjectIterator<Long>
,Iterator<Long>
,PrimitiveIterator<Long,
,LongConsumer> PrimitiveIterator.OfLong
- Enclosing class:
- EliasFanoPrefixSumLongBigList
public class EliasFanoPrefixSumLongBigList.EliasFanoPrefixSumLongBigListIterator
extends EliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator
An list iterator over the values of this
EliasFanoPrefixSumLongBigList
.
Forward iteration will be faster than iterated calls to
getLong()
. Backward iteration is available,
but it will performs 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 last value returned.protected long[]
The upper bits as a long array.Fields inherited from class it.unimi.dsi.sux4j.util.EliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator
index, lowerBitsPosition, window, word
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
hasNext()
boolean
long
long
Returns the same element asEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator.nextLong()
, ifhasNext()
is true; otherwise, behavior is undefined.long
long
Returns the same element asEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator.previousLong()
, ifhasPrevious()
is true; otherwise, behavior is undefined.Methods inherited from class it.unimi.dsi.sux4j.util.EliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator
nextLong, previousLong
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
-
last
protected long lastThe last value returned. -
upperBits
protected long[] upperBitsThe upper bits as a long array.
-
-
Constructor Details
-
EliasFanoPrefixSumLongBigListIterator
protected EliasFanoPrefixSumLongBigListIterator(long from)
-
-
Method Details
-
previousIndex
public long previousIndex()- Specified by:
previousIndex
in interfaceBigListIterator<Long>
- Overrides:
previousIndex
in classEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator
-
nextIndex
public long nextIndex()- Specified by:
nextIndex
in interfaceBigListIterator<Long>
- Overrides:
nextIndex
in classEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator
-
hasPrevious
public boolean hasPrevious()- Specified by:
hasPrevious
in interfaceBidirectionalIterator<Long>
- Overrides:
hasPrevious
in classEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in interfaceIterator<Long>
- Overrides:
hasNext
in classEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator
-
nextLongUnsafe
public long nextLongUnsafe()Returns the same element asEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator.nextLong()
, ifhasNext()
is true; otherwise, behavior is undefined.- Overrides:
nextLongUnsafe
in classEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator
- Returns:
- the same element as
EliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator.nextLong()
, ifhasNext()
is true; otherwise, behavior is undefined.
-
previousLongUnsafe
public long previousLongUnsafe()Returns the same element asEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator.previousLong()
, ifhasPrevious()
is true; otherwise, behavior is undefined.- Overrides:
previousLongUnsafe
in classEliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator
- Returns:
- the same element as
EliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator.previousLong()
, ifhasPrevious()
is true; otherwise, behavior is undefined.
-