Package org.agrona.collections
Class Int2NullableObjectHashMap<V>
- java.lang.Object
-
- org.agrona.collections.Int2ObjectHashMap<V>
-
- org.agrona.collections.Int2NullableObjectHashMap<V>
-
- Type Parameters:
V
- type of values stored in theMap
- All Implemented Interfaces:
java.util.Map<java.lang.Integer,V>
public class Int2NullableObjectHashMap<V> extends Int2ObjectHashMap<V>
Variation ofInt2ObjectHashMap
that allowsnull
values.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.agrona.collections.Int2ObjectHashMap
Int2ObjectHashMap.AbstractIterator<T>, Int2ObjectHashMap.EntryIterator, Int2ObjectHashMap.EntrySet, Int2ObjectHashMap.KeyIterator, Int2ObjectHashMap.KeySet, Int2ObjectHashMap.ValueCollection, Int2ObjectHashMap.ValueIterator
-
-
Field Summary
-
Fields inherited from class org.agrona.collections.Int2ObjectHashMap
MIN_CAPACITY
-
-
Constructor Summary
Constructors Constructor Description Int2NullableObjectHashMap()
Constructs map with default settings.Int2NullableObjectHashMap(int initialCapacity, float loadFactor)
Constructs map with given initial capacity and load factory and enables caching of iterators.Int2NullableObjectHashMap(int initialCapacity, float loadFactor, boolean shouldAvoidAllocation)
Construct a new map allowing a configuration for initial capacity and load factor.Int2NullableObjectHashMap(Int2ObjectHashMap<V> mapToCopy)
Copy construct a new map from an existing one.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Object
mapNullValue(java.lang.Object value)
Interceptor for masking null values.protected V
unmapNullValue(java.lang.Object value)
Interceptor for unmasking null values.-
Methods inherited from class org.agrona.collections.Int2ObjectHashMap
capacity, clear, compact, compute, compute, computeIfAbsent, computeIfAbsent, computeIfPresent, computeIfPresent, containsKey, containsKey, containsValue, entrySet, equals, forEach, forEachInt, get, get, getMapped, getOrDefault, hashCode, intForEach, isEmpty, keySet, loadFactor, merge, merge, put, put, putAll, putAll, putIfAbsent, remove, remove, remove, remove, replace, replace, replaceAll, replaceAllInt, resizeThreshold, size, toString, values
-
-
-
-
Constructor Detail
-
Int2NullableObjectHashMap
public Int2NullableObjectHashMap()
Constructs map with default settings.
-
Int2NullableObjectHashMap
public Int2NullableObjectHashMap(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.
-
Int2NullableObjectHashMap
public Int2NullableObjectHashMap(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.
-
Int2NullableObjectHashMap
public Int2NullableObjectHashMap(Int2ObjectHashMap<V> mapToCopy)
Copy construct a new map from an existing one.- Parameters:
mapToCopy
- for construction.
-
-
Method Detail
-
mapNullValue
protected java.lang.Object mapNullValue(java.lang.Object value)
Description copied from class:Int2ObjectHashMap
Interceptor for masking null values.- Overrides:
mapNullValue
in classInt2ObjectHashMap<V>
- Parameters:
value
- value to mask.- Returns:
- masked value.
-
unmapNullValue
protected V unmapNullValue(java.lang.Object value)
Description copied from class:Int2ObjectHashMap
Interceptor for unmasking null values.- Overrides:
unmapNullValue
in classInt2ObjectHashMap<V>
- Parameters:
value
- value to unmask.- Returns:
- unmasked value.
-
-