Class ChunkIteratorImpl

java.lang.Object
com.googlecode.javaewah.ChunkIteratorImpl
All Implemented Interfaces:
ChunkIterator

final class ChunkIteratorImpl extends Object implements ChunkIterator
The ChunkIteratorImpl is the 64 bit implementation of the ChunkIterator interface, which efficiently returns the chunks of ones and zeros represented by an EWAHIterator.
  • Field Details

    • ewahIter

      private final EWAHIterator ewahIter
    • sizeInBits

      private final int sizeInBits
    • buffer

      private final Buffer buffer
    • position

      private int position
    • runningBit

      private boolean runningBit
    • runningLength

      private int runningLength
    • word

      private long word
    • wordMask

      private long wordMask
    • wordPosition

      private int wordPosition
    • wordLength

      private int wordLength
    • hasNext

      private boolean hasNext
    • nextBit

      private Boolean nextBit
    • nextLength

      private int nextLength
  • Constructor Details

    • ChunkIteratorImpl

      ChunkIteratorImpl(EWAHIterator ewahIter, int sizeInBits)
  • Method Details

    • hasNext

      public boolean hasNext()
      Description copied from interface: ChunkIterator
      Is there more?
      Specified by:
      hasNext in interface ChunkIterator
      Returns:
      true, if there is more, false otherwise
    • nextBit

      public boolean nextBit()
      Description copied from interface: ChunkIterator
      Return the next bit
      Specified by:
      nextBit in interface ChunkIterator
      Returns:
      the bit
    • nextLength

      public int nextLength()
      Description copied from interface: ChunkIterator
      Return the length of the next bit
      Specified by:
      nextLength in interface ChunkIterator
      Returns:
      the length
    • move

      public void move()
      Description copied from interface: ChunkIterator
      Move the iterator at the next different bit
      Specified by:
      move in interface ChunkIterator
    • move

      public void move(int bits)
      Description copied from interface: ChunkIterator
      Move the iterator at the next ith bit
      Specified by:
      move in interface ChunkIterator
      Parameters:
      bits - the number of bits to skip
    • moveToNextRLW

      private boolean moveToNextRLW()
    • setRLW

      private void setRLW(RunningLengthWord rlw)
    • runningHasNext

      private boolean runningHasNext()
    • literalHasNext

      private boolean literalHasNext()
    • hasNextRLW

      private boolean hasNextRLW()
    • nextRLW

      private RunningLengthWord nextRLW()
    • updateNext

      private void updateNext()
    • runningOffset

      private int runningOffset()
    • movePosition

      private void movePosition(int offset)
    • currentWordBit

      private boolean currentWordBit()
    • shiftWordMask

      private void shiftWordMask()