Class BufferedIterator

  • All Implemented Interfaces:
    IteratingRLW

    public class BufferedIterator
    extends java.lang.Object
    implements IteratingRLW
    This class can be used to iterate over blocks of bitmap data.
    Author:
    Daniel Lemire
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      BufferedIterator clone()  
      void discardFirstWords​(long x)
      Discard first words, iterating to the next running length word if needed.
      long getLiteralWordAt​(int index)
      Get the nth literal word for the current running length word
      int getNumberOfLiteralWords()
      Gets the number of literal words for the current running length word.
      boolean getRunningBit()
      Gets the running bit.
      long getRunningLength()
      Gets the running length.
      boolean next()
      Move to the next RunningLengthWord
      long size()
      Size in uncompressed words of the current running length word.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BufferedIterator

        public BufferedIterator​(CloneableIterator<EWAHIterator> iterator)
        Instantiates a new iterating buffered running length word.
        Parameters:
        iterator - iterator
    • Method Detail

      • discardFirstWords

        public void discardFirstWords​(long x)
        Discard first words, iterating to the next running length word if needed.
        Specified by:
        discardFirstWords in interface IteratingRLW
        Parameters:
        x - the number of words to be discarded
      • next

        public boolean next()
        Move to the next RunningLengthWord
        Specified by:
        next in interface IteratingRLW
        Returns:
        whether the move was possible
      • getLiteralWordAt

        public long getLiteralWordAt​(int index)
        Get the nth literal word for the current running length word
        Specified by:
        getLiteralWordAt in interface IteratingRLW
        Parameters:
        index - zero based index
        Returns:
        the literal word
      • getNumberOfLiteralWords

        public int getNumberOfLiteralWords()
        Gets the number of literal words for the current running length word.
        Specified by:
        getNumberOfLiteralWords in interface IteratingRLW
        Returns:
        the number of literal words
      • getRunningBit

        public boolean getRunningBit()
        Gets the running bit.
        Specified by:
        getRunningBit in interface IteratingRLW
        Returns:
        the running bit
      • getRunningLength

        public long getRunningLength()
        Gets the running length.
        Specified by:
        getRunningLength in interface IteratingRLW
        Returns:
        the running length
      • size

        public long size()
        Size in uncompressed words of the current running length word.
        Specified by:
        size in interface IteratingRLW
        Returns:
        the size
      • clone

        public BufferedIterator clone()
                               throws java.lang.CloneNotSupportedException
        Specified by:
        clone in interface IteratingRLW
        Overrides:
        clone in class java.lang.Object
        Returns:
        a copy of the iterator
        Throws:
        java.lang.CloneNotSupportedException - this should not be thrown in theory