Interface OffHeapLongObjectMap<V>

Type Parameters:
V - The value type.
All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
OffHeapLongObjectMapImpl

public interface OffHeapLongObjectMap<V> extends AutoCloseable
A primitive long-to-Object map backed by off-heap memory for the keys/structure.

Designed for zero-allocation lookups on hot paths. The keys are stored in off-heap memory (MemorySegment). The values are stored in a standard Java Object array (on-heap).

  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    Releases the underlying off-heap memory.
    boolean
    containsKey(long key)
     
    get(long key)
     
    boolean
     
    void
    put(long key, V value)
     
    remove(long key)
     
    int
     
  • Method Details

    • get

      V get(long key)
    • put

      void put(long key, V value)
    • remove

      V remove(long key)
    • clear

      void clear()
    • size

      int size()
    • isEmpty

      boolean isEmpty()
    • containsKey

      boolean containsKey(long key)
    • close

      void close()
      Releases the underlying off-heap memory.
      Specified by:
      close in interface AutoCloseable