Class OffHeapLongObjectMapImpl<V>
java.lang.Object
express.mvp.roray.utils.collections.OffHeapLongObjectMapImpl<V>
- All Implemented Interfaces:
OffHeapLongObjectMap<V>, AutoCloseable
A linear-probing, open-addressing hash map with off-heap keys and on-heap values.
Not thread-safe. Designed for single-threaded hot paths.
-
Constructor Summary
ConstructorsConstructorDescriptionOffHeapLongObjectMapImpl(int capacity) Creates a new off-heap long-to-object map with specified capacity. -
Method Summary
-
Constructor Details
-
OffHeapLongObjectMapImpl
public OffHeapLongObjectMapImpl(int capacity) Creates a new off-heap long-to-object map with specified capacity.- Parameters:
capacity- the capacity (must be a power of 2)
-
-
Method Details
-
get
- Specified by:
getin interfaceOffHeapLongObjectMap<V>
-
put
- Specified by:
putin interfaceOffHeapLongObjectMap<V>
-
remove
- Specified by:
removein interfaceOffHeapLongObjectMap<V>
-
clear
public void clear()- Specified by:
clearin interfaceOffHeapLongObjectMap<V>
-
size
public int size()- Specified by:
sizein interfaceOffHeapLongObjectMap<V>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceOffHeapLongObjectMap<V>
-
containsKey
public boolean containsKey(long key) - Specified by:
containsKeyin interfaceOffHeapLongObjectMap<V>
-
close
public void close()Description copied from interface:OffHeapLongObjectMapReleases the underlying off-heap memory.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceOffHeapLongObjectMap<V>
-