Class BasicIterablePosting

    • Field Detail

      • numEntries

        protected int numEntries
      • bitFileReader

        protected BitIn bitFileReader
    • Constructor Detail

      • BasicIterablePosting

        public BasicIterablePosting()
        Empty constructor used ONLY for reflection
      • BasicIterablePosting

        public BasicIterablePosting​(BitIn _bitFileReader,
                                    int _numEntries,
                                    DocumentIndex _doi)
                             throws java.io.IOException
        Constructor
        Parameters:
        _bitFileReader - The bit file where we read the postings from
        _numEntries - Total number of postings to read before returning EOL
        _doi - The document index to get the doc length of the current docid
        Throws:
        java.io.IOException
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • next

        public int next()
                 throws java.io.IOException
        Description copied from interface: IterablePosting
        Move this iterator to the next posting.
        Specified by:
        next in interface IterablePosting
        Returns:
        id of next posting, or EOL if end of posting list.
        Throws:
        java.io.IOException
      • next

        public int next​(int target)
                 throws java.io.IOException
        Description copied from interface: IterablePosting
        Move this iterator to the posting with specified id, or next posting after that if a posting with the specified id does not exist. This is usually implemented internally by IterablePosting.next(), but more efficient implementations can override this behaviour.
        Specified by:
        next in interface IterablePosting
        Parameters:
        target - id of the posting to find in this posting list.
        Returns:
        id of the posting found, or EOL if end of posting list is reached.
        Throws:
        java.io.IOException