Package it.unimi.dsi.sux4j.util
Class EliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator
- java.lang.Object
-
- it.unimi.dsi.sux4j.util.EliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator
-
- All Implemented Interfaces:
it.unimi.dsi.fastutil.BidirectionalIterator<java.lang.Long>,it.unimi.dsi.fastutil.BigListIterator<java.lang.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<java.lang.Long>,it.unimi.dsi.fastutil.objects.ObjectIterator<java.lang.Long>,java.util.Iterator<java.lang.Long>,java.util.PrimitiveIterator<java.lang.Long,java.util.function.LongConsumer>,java.util.PrimitiveIterator.OfLong
- Direct Known Subclasses:
EliasFanoIndexedMonotoneLongBigList.EliasFanoIndexedMonotoneLongBigListIterator,EliasFanoPrefixSumLongBigList.EliasFanoPrefixSumLongBigListIterator
- Enclosing class:
- EliasFanoMonotoneLongBigList
public class EliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator extends java.lang.Object implements it.unimi.dsi.fastutil.longs.LongBigListIteratorA list iterator over the values of thisEliasFanoMonotoneLongBigList.Forward iteration will be faster than iterated calls to
getLong(). Backward iteration is available, but it will perform similarly togetLong().Additional unsafe methods
nextLongUnsafe()andpreviousLongUnsafe()iterate without checking for the existence of a next element.
-
-
Field Summary
Fields Modifier and Type Field Description protected longindexThe index of the next element to return.protected longlowerBitsPositionThe current position in the array of lower bits.protected longwindowThe current window.protected intwordThe current word in the array of upper bits.
-
Constructor Summary
Constructors Modifier Constructor Description protectedEliasFanoMonotoneLongBigListIterator(long from)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()booleanhasPrevious()longnextIndex()longnextLong()longnextLongUnsafe()Returns the same element asnextLong(), ifhasNext()is true; otherwise, behavior is undefined.longpreviousIndex()longpreviousLong()longpreviousLongUnsafe()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
-
-
-
-
Method Detail
-
previousIndex
public long previousIndex()
- Specified by:
previousIndexin interfaceit.unimi.dsi.fastutil.BigListIterator<java.lang.Long>
-
nextIndex
public long nextIndex()
- Specified by:
nextIndexin interfaceit.unimi.dsi.fastutil.BigListIterator<java.lang.Long>
-
hasPrevious
public boolean hasPrevious()
- Specified by:
hasPreviousin interfaceit.unimi.dsi.fastutil.BidirectionalIterator<java.lang.Long>
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<java.lang.Long>
-
nextLong
public long nextLong()
- Specified by:
nextLongin interfaceit.unimi.dsi.fastutil.longs.LongIterator- Specified by:
nextLongin interfacejava.util.PrimitiveIterator.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:
previousLongin interfaceit.unimi.dsi.fastutil.longs.LongBidirectionalIterator
-
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.
-
-