org.apache.cassandra.utils.obs

## Class OffHeapBitSet

- java.lang.Object
- - org.apache.cassandra.utils.obs.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 Summary

    Constructors
    Constructor and Description
    `OffHeapBitSet(long numBits)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addTo(Ref.IdentityCollection identities)`
    `long` | `capacity()`
    `void` | `clear()`
    `void` | `clear(long index)` clears the bit.
    `void` | `close()`
    `static OffHeapBitSet` | `deserialize(java.io.DataInput in)`
    `boolean` | `equals(java.lang.Object o)`
    `boolean` | `get(long index)` Returns true or false for the specified bit index.
    `int` | `hashCode()`
    `long` | `offHeapSize()` Returns the amount of memory in bytes used off heap.
    `void` | `serialize(java.io.DataOutput out)`
    `long` | `serializedSize()`
    `void` | `set(long index)` Sets the bit at the specified index.
    `void` | `set(long offset, byte b)`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### 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

    - #### addTo

          public void addTo(Ref.IdentityCollection identities)

      Specified by:
        `addTo` in interface `IBitSet`

    - #### 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(java.io.DataOutput out)
                         throws java.io.IOException

      Specified by:
        `serialize` in interface `IBitSet`
      Throws:
        `java.io.IOException`

    - #### serializedSize

          public long serializedSize()

      Specified by:
        `serializedSize` in interface `IBitSet`

    - #### deserialize

          public static OffHeapBitSet deserialize(java.io.DataInput in)
                                           throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### close

          public void close()

      Specified by:
        `close` in interface `java.io.Closeable`
      Specified by:
        `close` in interface `java.lang.AutoCloseable`
      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`

Copyright © 2018 The Apache Software Foundation