Class BitArray

org.elasticsearch.common.util.BitArray
All Implemented Interfaces:
, , org.elasticsearch.core.Releasable

public final class BitArray extends implements org.elasticsearch.core.Releasable
A bit array that is implemented using a growing LongArray created from BigArrays. The underlying long array grows lazily based on the biggest index that needs to be set.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BitArray​(long initialSize, BigArrays bigArrays)
    Create the BitArray.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
     
    void
    clear​(long index)
    Clear the indexth bit.
    void
     
    boolean
    get​(long index)
    Is the indexth bit set?
    long
    nextSetBit​(long index)
     
    void
    or​(BitArray other)
    this = this OR other
    void
    set​(long index)
    Set the indexth bit.

    Methods inherited from class java.lang.

    , , , , , , , , , ,
  • Constructor Details

    • BitArray

      public BitArray(long initialSize, BigArrays bigArrays)
      Create the BitArray.
      Parameters:
      initialSize - the initial size of underlying storage expressed in bits.
  • Method Details

    • set

      public void set(long index)
      Set the indexth bit.
    • or

      public void or(BitArray other)
      this = this OR other
    • nextSetBit

      public long nextSetBit(long index)
    • cardinality

      public long cardinality()
    • clear

      public void clear(long index)
      Clear the indexth bit.
    • get

      public boolean get(long index)
      Is the indexth bit set?
    • close

      public void close()
      Specified by:
       in interface 
      Specified by:
       in interface 
      Specified by:
      close in interface org.elasticsearch.core.Releasable