Class BitsSlice

  • All Implemented Interfaces:
    Bits

    final class BitsSlice
    extends java.lang.Object
    implements Bits
    Exposes a slice of an existing Bits as a new Bits.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int length  
      private Bits parent  
      private int start  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean get​(int doc)
      Returns the value of the bit with the specified index.
      int length()
      Returns the number of bits in this set
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • parent

        private final Bits parent
      • start

        private final int start
      • length

        private final int length
    • Constructor Detail

    • Method Detail

      • get

        public boolean get​(int doc)
        Description copied from interface: Bits
        Returns the value of the bit with the specified index.
        Specified by:
        get in interface Bits
        Parameters:
        doc - index, should be non-negative and < Bits.length(). The result of passing negative or out of bounds values is undefined by this interface, just don't do it!
        Returns:
        true if the bit is set, false otherwise.
      • length

        public int length()
        Description copied from interface: Bits
        Returns the number of bits in this set
        Specified by:
        length in interface Bits