Package org.agrona.collections
Class Long2NullableObjectHashMap<V>
java.lang.Object
org.agrona.collections.Long2ObjectHashMap<V>
org.agrona.collections.Long2NullableObjectHashMap<V>
- Type Parameters:
V
- type of values stored in theMap
Variation of
Long2ObjectHashMap
that allows null
values.-
Nested Class Summary
Nested classes/interfaces inherited from class org.agrona.collections.Long2ObjectHashMap
Long2ObjectHashMap.AbstractIterator<T>, Long2ObjectHashMap.EntryIterator, Long2ObjectHashMap.EntrySet, Long2ObjectHashMap.KeyIterator, Long2ObjectHashMap.KeySet, Long2ObjectHashMap.ValueCollection, Long2ObjectHashMap.ValueIterator
-
Field Summary
Fields inherited from class org.agrona.collections.Long2ObjectHashMap
MIN_CAPACITY
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs map with default settings.Long2NullableObjectHashMap
(int initialCapacity, float loadFactor) Constructs map with given initial capacity and load factory and enables caching of iterators.Long2NullableObjectHashMap
(int initialCapacity, float loadFactor, boolean shouldAvoidAllocation) Construct a new map allowing a configuration for initial capacity and load factor.Long2NullableObjectHashMap
(Long2ObjectHashMap<V> mapToCopy) Copy construct a new map from an existing one. -
Method Summary
Modifier and TypeMethodDescriptionprotected Object
mapNullValue
(Object value) Longerceptor for masking null values.protected V
unmapNullValue
(Object value) Longerceptor for unmasking null values.Methods inherited from class org.agrona.collections.Long2ObjectHashMap
capacity, clear, compact, compute, compute, computeIfAbsent, computeIfAbsent, computeIfPresent, computeIfPresent, containsKey, containsKey, containsValue, entrySet, equals, forEach, forEachLong, get, get, getMapped, getOrDefault, hashCode, isEmpty, keySet, loadFactor, longForEach, merge, merge, put, put, putAll, putAll, putIfAbsent, remove, remove, remove, remove, replace, replace, replaceAll, replaceAllLong, resizeThreshold, size, toString, values
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
getOrDefault, putIfAbsent, replace, replace
-
Constructor Details
-
Long2NullableObjectHashMap
public Long2NullableObjectHashMap()Constructs map with default settings. -
Long2NullableObjectHashMap
public Long2NullableObjectHashMap(int initialCapacity, float loadFactor) Constructs map with given initial capacity and load factory and enables caching of iterators.- Parameters:
initialCapacity
- for the backing array.loadFactor
- limit for resizing on puts.
-
Long2NullableObjectHashMap
public Long2NullableObjectHashMap(int initialCapacity, float loadFactor, boolean shouldAvoidAllocation) Construct a new map allowing a configuration for initial capacity and load factor.- Parameters:
initialCapacity
- for the backing arrayloadFactor
- limit for resizing on putsshouldAvoidAllocation
- should allocation be avoided by caching iterators and map entries.
-
Long2NullableObjectHashMap
Copy construct a new map from an existing one.- Parameters:
mapToCopy
- for construction.
-
-
Method Details
-
mapNullValue
Description copied from class:Long2ObjectHashMap
Longerceptor for masking null values.- Overrides:
mapNullValue
in classLong2ObjectHashMap<V>
- Parameters:
value
- value to mask.- Returns:
- masked value.
-
unmapNullValue
Description copied from class:Long2ObjectHashMap
Longerceptor for unmasking null values.- Overrides:
unmapNullValue
in classLong2ObjectHashMap<V>
- Parameters:
value
- value to unmask.- Returns:
- unmasked value.
-