Class OffHeapBitSet

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, IBitSet

    public class OffHeapBitSet
    extends java.lang.Object
    implements IBitSet
    Off-heap bitset, file compatible with OpeBitSet
    • Constructor Detail

      • OffHeapBitSet

        public OffHeapBitSet​(long numBits)
    • Method Detail

      • capacity

        public long capacity()
        Specified by:
        capacity in interface IBitSet
      • offHeapSize

        public long offHeapSize()
        Description copied from interface: IBitSet
        Returns the amount of memory in bytes used off heap.
        Specified by:
        offHeapSize in interface IBitSet
        Returns:
        the amount of memory in bytes used off heap
      • get

        public boolean get​(long index)
        Description copied from interface: IBitSet
        Returns true or false for the specified bit index. The index should be less than the capacity.
        Specified by:
        get in interface IBitSet
      • set

        public void set​(long index)
        Description copied from interface: IBitSet
        Sets the bit at the specified index. The index should be less than the capacity.
        Specified by:
        set in interface IBitSet
      • set

        public void set​(long offset,
                        byte b)
      • clear

        public void clear​(long index)
        Description copied from interface: IBitSet
        clears the bit. The index should be less than the capacity.
        Specified by:
        clear in interface IBitSet
      • clear

        public void clear()
        Specified by:
        clear in interface IBitSet
      • serialize

        public void serialize​(DataOutputPlus out)
                       throws java.io.IOException
        Specified by:
        serialize in interface IBitSet
        Throws:
        java.io.IOException
      • serializeOldBfFormat

        public void serializeOldBfFormat​(DataOutputPlus out)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • deserialize

        public static <I extends java.io.InputStream & java.io.DataInput> OffHeapBitSet deserialize​(I in,
                                                                                                    boolean oldBfFormat)
                                                                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface IBitSet
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object