it.unimi.di.mg4j.tool
Class Combine.GammaCodedIntIterator

java.lang.Object
  extended by it.unimi.dsi.fastutil.ints.AbstractIntIterator
      extended by it.unimi.di.mg4j.tool.Combine.GammaCodedIntIterator
All Implemented Interfaces:
IntIterator, Closeable, Iterator<Integer>
Enclosing class:
Combine

protected static final class Combine.GammaCodedIntIterator
extends AbstractIntIterator
implements Closeable

A partial IntIterator implementation based on γ-coded integers.

Instances of this class adapt an InputBitStream to an IntIterator by reading γ-coded integers. The implementation is partial because hasNext() always returns true—the user must know in advance how many times nextInt() may be safely called.

See Also:
Combine.sizes(int)

Constructor Summary
Combine.GammaCodedIntIterator(InputBitStream inputBitStream)
           
 
Method Summary
 void close()
          Delegates to the underlying InputBitStream.
 boolean hasNext()
          Returns true.
 int nextInt()
          Returns the next γ-coded integer in the underlying InputBitStream.
 
Methods inherited from class it.unimi.dsi.fastutil.ints.AbstractIntIterator
next, remove, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Combine.GammaCodedIntIterator

public Combine.GammaCodedIntIterator(InputBitStream inputBitStream)
Method Detail

hasNext

public boolean hasNext()
Returns true.

Specified by:
hasNext in interface Iterator<Integer>
Returns:
true

nextInt

public int nextInt()
Returns the next γ-coded integer in the underlying InputBitStream.

Specified by:
nextInt in interface IntIterator
Overrides:
nextInt in class AbstractIntIterator
Returns:
the result of InputBitStream.readGamma().

close

public void close()
           throws IOException
Delegates to the underlying InputBitStream.

Specified by:
close in interface Closeable
Throws:
IOException