Package it.unimi.di.big.mg4j.tool
Class Combine.GammaCodedIntIterator
- java.lang.Object
-
- it.unimi.di.big.mg4j.tool.Combine.GammaCodedIntIterator
-
- All Implemented Interfaces:
IntIterator,Closeable,AutoCloseable,Iterator<Integer>,PrimitiveIterator<Integer,IntConsumer>,PrimitiveIterator.OfInt
- Enclosing class:
- Combine
protected static final class Combine.GammaCodedIntIterator extends Object implements IntIterator, Closeable
A partialIntIteratorimplementation based on γ-coded integers.Instances of this class adapt an
InputBitStreamto anIntIteratorby reading γ-coded integers. The implementation is partial becausehasNext()always returns true—the user must know in advance how many timesnextInt()may be safely called.- See Also:
Combine.sizes(int)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface java.util.PrimitiveIterator
PrimitiveIterator.OfDouble, PrimitiveIterator.OfInt, PrimitiveIterator.OfLong
-
-
Constructor Summary
Constructors Constructor Description GammaCodedIntIterator(InputBitStream inputBitStream)
-
Method Summary
Modifier and Type Method Description voidclose()Delegates to the underlyingInputBitStream.booleanhasNext()Returns true.intnextInt()Returns the next γ-coded integer in the underlyingInputBitStream.-
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.ints.IntIterator
forEachRemaining, next, skip
-
Methods inherited from interface java.util.PrimitiveIterator.OfInt
forEachRemaining
-
-
-
-
Constructor Detail
-
GammaCodedIntIterator
public GammaCodedIntIterator(InputBitStream inputBitStream)
-
-
Method Detail
-
hasNext
public boolean hasNext()
Returns true.
-
nextInt
public int nextInt()
Returns the next γ-coded integer in the underlyingInputBitStream.- Specified by:
nextIntin interfaceIntIterator- Specified by:
nextIntin interfacePrimitiveIterator.OfInt- Returns:
- the result of
InputBitStream.readGamma().
-
close
public void close() throws IOExceptionDelegates to the underlyingInputBitStream.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-