Class DirectBitArrayR

java.lang.Object
org.apache.datasketches.filters.bloomfilter.DirectBitArrayR
All Implemented Interfaces:
MemorySegmentStatus

public class DirectBitArrayR extends Object
This class can maintain the BitArray object off-heap.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if this object's internal data is backed by a MemorySegment, which may be on-heap or off-heap.
    boolean
    Returns true if this object's internal data is backed by an off-heap (direct or native)) MemorySegment.
    boolean
     
    boolean
    Returns true if an internally referenced MemorySegment has the same backing resource as that, or equivalently, if their two memory regions overlap.
     

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • hasMemorySegment

      public boolean hasMemorySegment()
      Description copied from interface: MemorySegmentStatus
      Returns true if this object's internal data is backed by a MemorySegment, which may be on-heap or off-heap.
      Specified by:
      hasMemorySegment in interface MemorySegmentStatus
      Returns:
      true if this object's internal data is backed by a MemorySegment.
    • isOffHeap

      public boolean isOffHeap()
      Description copied from interface: MemorySegmentStatus
      Returns true if this object's internal data is backed by an off-heap (direct or native)) MemorySegment.
      Specified by:
      isOffHeap in interface MemorySegmentStatus
      Returns:
      true if this object's internal data is backed by an off-heap (direct or native)) MemorySegment.
    • isReadOnly

      public boolean isReadOnly()
    • isSameResource

      public boolean isSameResource(MemorySegment that)
      Description copied from interface: MemorySegmentStatus
      Returns true if an internally referenced MemorySegment has the same backing resource as that, or equivalently, if their two memory regions overlap. This applies to both on-heap and off-heap MemorySegments.

      Note: If both segments are on-heap and not read-only, it can be determined if they were derived from the same backing memory (array). However, this is not always possible off-heap. Because of this asymmetry, this definition of "isSameResource" is confined to the existence of an overlap.

      Specified by:
      isSameResource in interface MemorySegmentStatus
      Parameters:
      that - The given MemorySegment.
      Returns:
      true if an internally referenced MemorySegment has the same backing resource as that.
    • toString

      public String toString()
      Overrides:
      toString in class Object