Class BitSetHits

  • All Implemented Interfaces:
    Hits

    public class BitSetHits
    extends Object
    implements Hits
    Uses a BitSet instance to store the hit set. Keep in mind that this BitSet is at least as large as the highest doc number in the hit set. This means it might need of lot of memory for large indexes.
    • Constructor Detail

      • BitSetHits

        public BitSetHits()
    • Method Detail

      • set

        public void set​(int doc)
        Marks the document with doc number doc as a hit. Implementations may throw an exception if you call set() after next() or skipTo() has been called.
        Specified by:
        set in interface Hits
      • next

        public int next()
        Return the doc number of the next hit in the set. Subsequent calls never return the same doc number.
        Specified by:
        next in interface Hits
      • skipTo

        public int skipTo​(int target)
        Skips to the first match beyond the current whose document number is greater than or equal to the given target. Returns -1 if there is no matching document number greater than target.
        Specified by:
        skipTo in interface Hits