V - the type of elements maintained by this Collectionpublic class Long2ObjectOpenCustomHashMap<V> extends AbstractLong2ObjectMap<V>
AbstractLong2ObjectMap.BasicEntry<V>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Long2ObjectMap.Entry<V>, Long2ObjectMap.FastEntrySet<V>| Constructor and Description |
|---|
Long2ObjectOpenCustomHashMap(int minCapacity,
float loadFactor,
LongStrategy strategy)
Constructor that defines the minimum capacity and load factor
|
Long2ObjectOpenCustomHashMap(int minCapacity,
LongStrategy strategy)
Constructor that defines the minimum capacity
|
Long2ObjectOpenCustomHashMap(long[] keys,
V[] values,
float loadFactor,
LongStrategy strategy)
Helper constructor that allow to create a map from unboxed values
|
Long2ObjectOpenCustomHashMap(java.lang.Long[] keys,
V[] values,
float loadFactor,
LongStrategy strategy)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Long2ObjectOpenCustomHashMap(long[] keys,
V[] values,
LongStrategy strategy)
Helper constructor that allow to create a map from unboxed values
|
Long2ObjectOpenCustomHashMap(java.lang.Long[] keys,
V[] values,
LongStrategy strategy)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Long2ObjectOpenCustomHashMap(Long2ObjectMap<V> map,
float loadFactor,
LongStrategy strategy)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Long2ObjectOpenCustomHashMap(Long2ObjectMap<V> map,
LongStrategy strategy)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Long2ObjectOpenCustomHashMap(LongStrategy strategy)
Default Contstructor
|
Long2ObjectOpenCustomHashMap(java.util.Map<? extends java.lang.Long,? extends V> map,
float loadFactor,
LongStrategy strategy)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Long2ObjectOpenCustomHashMap(java.util.Map<? extends java.lang.Long,? extends V> map,
LongStrategy 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(long key,
LongObjectUnaryOperator<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfAbsent(long key,
Long2ObjectFunction<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfPresent(long key,
LongObjectUnaryOperator<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(long 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(LongObjectConsumer<V> action)
Type Specific forEach method to reduce boxing/unboxing
|
V |
get(java.lang.Object key) |
V |
getObject(long key)
A Type Specific get method to reduce boxing/unboxing
|
V |
getOrDefault(long key,
V defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
LongSet |
keySet() |
ObjectSet<Long2ObjectMap.Entry<V>> |
long2ObjectEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
V |
merge(long key,
V value,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
void |
mergeAll(Long2ObjectMap<V> m,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Bulk method for merging Maps.
|
V |
put(long key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
putIfAbsent(long key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
remLong(long key)
Type Specific remove function to reduce boxing/unboxing
|
V |
remLongOrDefault(long key,
V defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
boolean |
remove(long 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(long key,
V value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(long 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 Long2ObjectOpenCustomHashMap(LongStrategy strategy)
strategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nullpublic Long2ObjectOpenCustomHashMap(int minCapacity,
LongStrategy 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 Long2ObjectOpenCustomHashMap(int minCapacity,
float loadFactor,
LongStrategy 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 Long2ObjectOpenCustomHashMap(java.lang.Long[] keys,
V[] values,
LongStrategy 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 Long2ObjectOpenCustomHashMap(java.lang.Long[] keys,
V[] values,
float loadFactor,
LongStrategy 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 Long2ObjectOpenCustomHashMap(long[] keys,
V[] values,
LongStrategy 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 Long2ObjectOpenCustomHashMap(long[] keys,
V[] values,
float loadFactor,
LongStrategy 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 Long2ObjectOpenCustomHashMap(java.util.Map<? extends java.lang.Long,? extends V> map, LongStrategy strategy)
map - the values that should be present in the mapstrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nullpublic Long2ObjectOpenCustomHashMap(java.util.Map<? extends java.lang.Long,? extends V> map, float loadFactor, LongStrategy 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 Long2ObjectOpenCustomHashMap(Long2ObjectMap<V> map, LongStrategy strategy)
map - the values that should be present in the mapstrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nullpublic Long2ObjectOpenCustomHashMap(Long2ObjectMap<V> map, float loadFactor, LongStrategy 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(long key, V value)
Long2ObjectMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public V putIfAbsent(long key, V value)
Long2ObjectMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public boolean containsKey(long key)
Long2ObjectMapcontainsKey in interface Long2ObjectMap<V>containsKey in class AbstractLong2ObjectMap<V>key - element that is searched for@Deprecated public boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Long,V>containsKey in interface Long2ObjectMap<V>containsKey in class java.util.AbstractMap<java.lang.Long,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.Long,V>containsValue in class AbstractLong2ObjectMap<V>public V remLong(long key)
Long2ObjectMapkey - the element that should be removedpublic V remLongOrDefault(long key, V defaultValue)
Long2ObjectMapkey - 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.Long,V>remove in interface Long2ObjectMap<V>remove in class java.util.AbstractMap<java.lang.Long,V>key - the element that should be removedMap.remove(Object)public boolean remove(long key,
V value)
Long2ObjectMapkey - 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(long key)
Long2ObjectMapkey - the key that is searched forpublic V get(java.lang.Object key)
get in interface java.util.Map<java.lang.Long,V>get in interface Long2ObjectMap<V>get in class AbstractLong2ObjectMap<V>public V getOrDefault(long key, V defaultValue)
Long2ObjectMapgetOrDefault in interface Long2ObjectMap<V>getOrDefault in class AbstractLong2ObjectMap<V>key - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic ObjectSet<Long2ObjectMap.Entry<V>> long2ObjectEntrySet()
Long2ObjectMappublic LongSet keySet()
keySet in interface java.util.Map<java.lang.Long,V>keySet in interface Long2ObjectMap<V>keySet in class AbstractLong2ObjectMap<V>public ObjectCollection<V> values()
values in interface java.util.Map<java.lang.Long,V>values in interface Long2ObjectMap<V>values in class AbstractLong2ObjectMap<V>public void forEach(LongObjectConsumer<V> action)
Long2ObjectMapforEach in interface Long2ObjectMap<V>forEach in class AbstractLong2ObjectMap<V>action - processor of the values that are iterator overpublic boolean replace(long key,
V oldValue,
V newValue)
Long2ObjectMapreplace in interface Long2ObjectMap<V>replace in class AbstractLong2ObjectMap<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(long key, V value)
Long2ObjectMapreplace in interface Long2ObjectMap<V>replace in class AbstractLong2ObjectMap<V>key - the element that should be searched forvalue - the value to replace with.public V compute(long key, LongObjectUnaryOperator<V> mappingFunction)
Long2ObjectMapcompute in interface Long2ObjectMap<V>compute in class AbstractLong2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the valuepublic V computeIfAbsent(long key, Long2ObjectFunction<V> mappingFunction)
Long2ObjectMapcomputeIfAbsent in interface Long2ObjectMap<V>computeIfAbsent in class AbstractLong2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic V computeIfPresent(long key, LongObjectUnaryOperator<V> mappingFunction)
Long2ObjectMapcomputeIfPresent in interface Long2ObjectMap<V>computeIfPresent in class AbstractLong2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic V merge(long key, V value, ObjectObjectUnaryOperator<V,V> mappingFunction)
Long2ObjectMapmerge in interface Long2ObjectMap<V>merge in class AbstractLong2ObjectMap<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(Long2ObjectMap<V> m, ObjectObjectUnaryOperator<V,V> mappingFunction)
Long2ObjectMapmergeAll in interface Long2ObjectMap<V>mergeAll in class AbstractLong2ObjectMap<V>m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic int size()