V - the type of elements maintained by this Collectionpublic class Int2ObjectOpenCustomHashMap<V> extends AbstractInt2ObjectMap<V>
AbstractInt2ObjectMap.BasicEntry<V>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Int2ObjectMap.Entry<V>, Int2ObjectMap.FastEntrySet<V>| Constructor and Description |
|---|
Int2ObjectOpenCustomHashMap(int[] keys,
V[] values,
float loadFactor,
IntStrategy strategy)
Helper constructor that allow to create a map from unboxed values
|
Int2ObjectOpenCustomHashMap(int[] keys,
V[] values,
IntStrategy strategy)
Helper constructor that allow to create a map from unboxed values
|
Int2ObjectOpenCustomHashMap(Int2ObjectMap<V> map,
float loadFactor,
IntStrategy strategy)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Int2ObjectOpenCustomHashMap(Int2ObjectMap<V> map,
IntStrategy strategy)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Int2ObjectOpenCustomHashMap(java.lang.Integer[] keys,
V[] values,
float loadFactor,
IntStrategy strategy)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Int2ObjectOpenCustomHashMap(java.lang.Integer[] keys,
V[] values,
IntStrategy strategy)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Int2ObjectOpenCustomHashMap(int minCapacity,
float loadFactor,
IntStrategy strategy)
Constructor that defines the minimum capacity and load factor
|
Int2ObjectOpenCustomHashMap(int minCapacity,
IntStrategy strategy)
Constructor that defines the minimum capacity
|
Int2ObjectOpenCustomHashMap(IntStrategy strategy)
Default Contstructor
|
Int2ObjectOpenCustomHashMap(java.util.Map<? extends java.lang.Integer,? extends V> map,
float loadFactor,
IntStrategy strategy)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Int2ObjectOpenCustomHashMap(java.util.Map<? extends java.lang.Integer,? extends V> map,
IntStrategy strategy)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
V |
compute(int key,
IntObjectUnaryOperator<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfAbsent(int key,
Int2ObjectFunction<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfPresent(int key,
IntObjectUnaryOperator<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(int key)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsKey(java.lang.Object key)
Deprecated.
|
boolean |
containsValue(java.lang.Object value)
Deprecated.
|
void |
forEach(IntObjectConsumer<V> action)
Type Specific forEach method to reduce boxing/unboxing
|
V |
get(java.lang.Object key) |
V |
getObject(int key)
A Type Specific get method to reduce boxing/unboxing
|
V |
getOrDefault(int key,
V defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
ObjectSet<Int2ObjectMap.Entry<V>> |
int2ObjectEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
IntSet |
keySet() |
V |
merge(int key,
V value,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
void |
mergeAll(Int2ObjectMap<V> m,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Bulk method for merging Maps.
|
V |
put(int key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
putIfAbsent(int key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
remInt(int key)
Type Specific remove function to reduce boxing/unboxing
|
V |
remIntOrDefault(int key,
V defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
boolean |
remove(int key,
V value)
Type Specific remove function to reduce boxing/unboxing
|
V |
remove(java.lang.Object key)
Deprecated.
|
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
V |
replace(int key,
V value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(int key,
V oldValue,
V newValue)
A Type Specific replace method to replace an existing value
|
int |
size() |
ObjectCollection<V> |
values() |
entrySet, equals, getDefaultReturnValue, getOrDefault, hashCode, putAll, putAll, putAll, putAllIfAbsent, replaceObjects, replaceObjects, setDefaultReturnValuecompute, computeIfAbsent, computeIfPresent, forEach, merge, put, putAll, putIfAbsent, replace, replace, replaceAllapplypublic Int2ObjectOpenCustomHashMap(IntStrategy strategy)
strategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nullpublic Int2ObjectOpenCustomHashMap(int minCapacity,
IntStrategy strategy)
minCapacity - the minimum capacity the HashMap is allowed to be.strategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if the minimum capacity is negativepublic Int2ObjectOpenCustomHashMap(int minCapacity,
float loadFactor,
IntStrategy strategy)
minCapacity - the minimum capacity the HashMap is allowed to be.loadFactor - the percentage of how full the backing array can be before they resizestrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if the minimum capacity is negativejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public Int2ObjectOpenCustomHashMap(java.lang.Integer[] keys,
V[] values,
IntStrategy strategy)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.strategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if the keys and values do not match in lenghtpublic Int2ObjectOpenCustomHashMap(java.lang.Integer[] keys,
V[] values,
float loadFactor,
IntStrategy strategy)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.loadFactor - the percentage of how full the backing array can be before they resizestrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if the keys and values do not match in lenghtjava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public Int2ObjectOpenCustomHashMap(int[] keys,
V[] values,
IntStrategy strategy)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.strategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if the keys and values do not match in lenghtpublic Int2ObjectOpenCustomHashMap(int[] keys,
V[] values,
float loadFactor,
IntStrategy strategy)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.loadFactor - the percentage of how full the backing array can be before they resizestrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if the keys and values do not match in lenghtjava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public Int2ObjectOpenCustomHashMap(java.util.Map<? extends java.lang.Integer,? extends V> map, IntStrategy strategy)
map - the values that should be present in the mapstrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nullpublic Int2ObjectOpenCustomHashMap(java.util.Map<? extends java.lang.Integer,? extends V> map, float loadFactor, IntStrategy strategy)
map - the values that should be present in the maploadFactor - the percentage of how full the backing array can be before they resizestrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public Int2ObjectOpenCustomHashMap(Int2ObjectMap<V> map, IntStrategy strategy)
map - the values that should be present in the mapstrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nullpublic Int2ObjectOpenCustomHashMap(Int2ObjectMap<V> map, float loadFactor, IntStrategy strategy)
map - the values that should be present in the maploadFactor - the percentage of how full the backing array can be before they resizestrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nulljava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public V put(int key, V value)
Int2ObjectMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public V putIfAbsent(int key, V value)
Int2ObjectMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public boolean containsKey(int key)
Int2ObjectMapcontainsKey in interface Int2ObjectMap<V>containsKey in class AbstractInt2ObjectMap<V>key - element that is searched for@Deprecated public boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Integer,V>containsKey in interface Int2ObjectMap<V>containsKey in class java.util.AbstractMap<java.lang.Integer,V>key - that is searched for.Map.containsKey(Object)@Deprecated public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.Integer,V>containsValue in class AbstractInt2ObjectMap<V>public V remInt(int key)
Int2ObjectMapkey - the element that should be removedpublic V remIntOrDefault(int key, V defaultValue)
Int2ObjectMapkey - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)@Deprecated public V remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Integer,V>remove in interface Int2ObjectMap<V>remove in class java.util.AbstractMap<java.lang.Integer,V>key - the element that should be removedMap.remove(Object)public boolean remove(int key,
V value)
Int2ObjectMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public boolean remove(java.lang.Object key,
java.lang.Object value)
key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public V getObject(int key)
Int2ObjectMapkey - the key that is searched forpublic V get(java.lang.Object key)
get in interface java.util.Map<java.lang.Integer,V>get in interface Int2ObjectMap<V>get in class AbstractInt2ObjectMap<V>public V getOrDefault(int key, V defaultValue)
Int2ObjectMapgetOrDefault in interface Int2ObjectMap<V>getOrDefault in class AbstractInt2ObjectMap<V>key - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic ObjectSet<Int2ObjectMap.Entry<V>> int2ObjectEntrySet()
Int2ObjectMappublic IntSet keySet()
keySet in interface java.util.Map<java.lang.Integer,V>keySet in interface Int2ObjectMap<V>keySet in class AbstractInt2ObjectMap<V>public ObjectCollection<V> values()
values in interface java.util.Map<java.lang.Integer,V>values in interface Int2ObjectMap<V>values in class AbstractInt2ObjectMap<V>public void forEach(IntObjectConsumer<V> action)
Int2ObjectMapforEach in interface Int2ObjectMap<V>forEach in class AbstractInt2ObjectMap<V>action - processor of the values that are iterator overpublic boolean replace(int key,
V oldValue,
V newValue)
Int2ObjectMapreplace in interface Int2ObjectMap<V>replace in class AbstractInt2ObjectMap<V>key - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public V replace(int key, V value)
Int2ObjectMapreplace in interface Int2ObjectMap<V>replace in class AbstractInt2ObjectMap<V>key - the element that should be searched forvalue - the value to replace with.public V compute(int key, IntObjectUnaryOperator<V> mappingFunction)
Int2ObjectMapcompute in interface Int2ObjectMap<V>compute in class AbstractInt2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the valuepublic V computeIfAbsent(int key, Int2ObjectFunction<V> mappingFunction)
Int2ObjectMapcomputeIfAbsent in interface Int2ObjectMap<V>computeIfAbsent in class AbstractInt2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic V computeIfPresent(int key, IntObjectUnaryOperator<V> mappingFunction)
Int2ObjectMapcomputeIfPresent in interface Int2ObjectMap<V>computeIfPresent in class AbstractInt2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic V merge(int key, V value, ObjectObjectUnaryOperator<V,V> mappingFunction)
Int2ObjectMapmerge in interface Int2ObjectMap<V>merge in class AbstractInt2ObjectMap<V>key - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuepublic void mergeAll(Int2ObjectMap<V> m, ObjectObjectUnaryOperator<V,V> mappingFunction)
Int2ObjectMapmergeAll in interface Int2ObjectMap<V>mergeAll in class AbstractInt2ObjectMap<V>m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic int size()