Class WrappedImmutableBitSetBitmap

java.lang.Object
org.apache.druid.collections.bitmap.WrappedImmutableBitSetBitmap
All Implemented Interfaces:
ImmutableBitmap
Direct Known Subclasses:
WrappedBitSetBitmap

public class WrappedImmutableBitSetBitmap extends Object implements ImmutableBitmap
WrappedImmutableBitSetBitmap implements ImmutableBitmap for java.util.BitSet
  • Field Details

    • bitmap

      protected final BitSet bitmap
  • Constructor Details

    • WrappedImmutableBitSetBitmap

      public WrappedImmutableBitSetBitmap(BitSet bitmap)
    • WrappedImmutableBitSetBitmap

      public WrappedImmutableBitSetBitmap()
    • WrappedImmutableBitSetBitmap

      public WrappedImmutableBitSetBitmap(ByteBuffer byteBuffer)
  • Method Details

    • iterator

      public org.roaringbitmap.IntIterator iterator()
      Specified by:
      iterator in interface ImmutableBitmap
      Returns:
      an iterator over the set bits of this bitmap
    • get

      public boolean get(int value)
      Description copied from interface: ImmutableBitmap
      Returns true if the bit at position value is set
      Specified by:
      get in interface ImmutableBitmap
      Parameters:
      value - the position to check
      Returns:
      true if bit is set
    • size

      public int size()
      Specified by:
      size in interface ImmutableBitmap
      Returns:
      The number of bits set to true in this bitmap
    • toBytes

      public byte[] toBytes()
      Specified by:
      toBytes in interface ImmutableBitmap
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface ImmutableBitmap
      Returns:
      True if this bitmap is empty (contains no set bit)
    • union

      public ImmutableBitmap union(ImmutableBitmap otherBitmap)
      Description copied from interface: ImmutableBitmap
      Compute the bitwise-or of this bitmap with another bitmap. A new bitmap is generated. Note that the other bitmap should be of the same class instance.
      Specified by:
      union in interface ImmutableBitmap
      Parameters:
      otherBitmap - other bitmap
    • intersection

      public ImmutableBitmap intersection(ImmutableBitmap otherBitmap)
      Description copied from interface: ImmutableBitmap
      Compute the bitwise-and of this bitmap with another bitmap. A new bitmap is generated. Note that the other bitmap should be of the same class instance.
      Specified by:
      intersection in interface ImmutableBitmap
      Parameters:
      otherBitmap - other bitmap