Interface OffHeapLongIntMap

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
OffHeapLongIntMapImpl

public interface OffHeapLongIntMap extends AutoCloseable
A primitive long-to-int map backed entirely by off-heap memory.

Designed for zero-allocation, zero-GC lookups on hot paths. Both keys and values are stored in off-heap memory.

  • Method Summary

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

    • get

      int get(long key)
      Gets the value for the given key.
      Parameters:
      key - The key.
      Returns:
      The value, or the configured "missing value" (default -1) if not found.
    • put

      void put(long key, int value)
    • remove

      int remove(long key)
      Removes the key and returns its value.
      Parameters:
      key - The key to remove.
      Returns:
      The value, or the "missing value" if not found.
    • 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