public class Long2FloatOpenCustomHashMap extends AbstractLong2FloatMap implements ITrimmable
AbstractLong2FloatMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Long2FloatMap.BuilderCache, Long2FloatMap.Entry, Long2FloatMap.FastEntrySet, Long2FloatMap.MapBuilder| Constructor and Description |
|---|
Long2FloatOpenCustomHashMap(int minCapacity,
float loadFactor,
LongStrategy strategy)
Constructor that defines the minimum capacity and load factor
|
Long2FloatOpenCustomHashMap(int minCapacity,
LongStrategy strategy)
Constructor that defines the minimum capacity
|
Long2FloatOpenCustomHashMap(long[] keys,
float[] values,
float loadFactor,
LongStrategy strategy)
Helper constructor that allow to create a map from unboxed values
|
Long2FloatOpenCustomHashMap(java.lang.Long[] keys,
java.lang.Float[] values,
float loadFactor,
LongStrategy strategy)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Long2FloatOpenCustomHashMap(long[] keys,
float[] values,
LongStrategy strategy)
Helper constructor that allow to create a map from unboxed values
|
Long2FloatOpenCustomHashMap(java.lang.Long[] keys,
java.lang.Float[] values,
LongStrategy strategy)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Long2FloatOpenCustomHashMap(Long2FloatMap 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.
|
Long2FloatOpenCustomHashMap(Long2FloatMap map,
LongStrategy strategy)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Long2FloatOpenCustomHashMap(LongStrategy strategy)
Default Contstructor
|
Long2FloatOpenCustomHashMap(java.util.Map<? extends java.lang.Long,? extends java.lang.Float> map,
float loadFactor,
LongStrategy strategy)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Long2FloatOpenCustomHashMap(java.util.Map<? extends java.lang.Long,? extends java.lang.Float> 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 |
|---|---|
float |
addTo(long key,
float value)
A Helper method to add a primitives together.
|
void |
clear() |
void |
clearAndTrim(int size)
Trims the collection down to the requested size and clears all elements while doing so
|
float |
computeFloat(long key,
LongFloatUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
float |
computeFloatIfAbsent(long key,
Long2FloatFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
float |
computeFloatIfPresent(long key,
LongFloatUnaryOperator 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(float value)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsValue(java.lang.Object value)
Deprecated.
|
Long2FloatOpenCustomHashMap |
copy()
A Function that does a shallow clone of the Map itself.
|
void |
forEach(LongFloatConsumer action)
Type Specific forEach method to reduce boxing/unboxing
|
float |
get(long key)
A Type Specific get method to reduce boxing/unboxing
|
java.lang.Float |
get(java.lang.Object key) |
float |
getOrDefault(long key,
float defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
LongSet |
keySet() |
ObjectSet<Long2FloatMap.Entry> |
long2FloatEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
void |
mergeAllFloat(Long2FloatMap m,
FloatFloatUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
float |
mergeFloat(long key,
float value,
FloatFloatUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
float |
put(long key,
float value)
Type Specific method to reduce boxing/unboxing of values
|
float |
putIfAbsent(long key,
float value)
Type Specific method to reduce boxing/unboxing of values
|
float |
remove(long key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(long key,
float value)
Type Specific remove function to reduce boxing/unboxing
|
java.lang.Float |
remove(java.lang.Object key) |
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
float |
removeOrDefault(long key,
float defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
float |
replace(long key,
float value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(long key,
float oldValue,
float newValue)
A Type Specific replace method to replace an existing value
|
int |
size() |
float |
subFrom(long key,
float value)
A Helper method to subtract from primitive from each other.
|
float |
supplyFloatIfAbsent(long key,
FloatSupplier valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
boolean |
trim(int size)
Trims the original collection down to the size of the current elements or the requested size depending which is bigger
|
FloatCollection |
values() |
addToAll, entrySet, equals, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, replaceFloats, replaceFloats, setDefaultReturnValueclearAndTrim, trimbuilder, compute, computeIfAbsent, computeIfPresent, forEach, merge, putAll, putAll, putIfAbsent, replace, replace, replaceAll, synchronize, synchronize, unmodifiablepublic Long2FloatOpenCustomHashMap(LongStrategy strategy)
strategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nullpublic Long2FloatOpenCustomHashMap(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 Long2FloatOpenCustomHashMap(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 Long2FloatOpenCustomHashMap(java.lang.Long[] keys,
java.lang.Float[] 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 Long2FloatOpenCustomHashMap(java.lang.Long[] keys,
java.lang.Float[] 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 Long2FloatOpenCustomHashMap(long[] keys,
float[] 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 Long2FloatOpenCustomHashMap(long[] keys,
float[] 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 Long2FloatOpenCustomHashMap(java.util.Map<? extends java.lang.Long,? extends java.lang.Float> 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 Long2FloatOpenCustomHashMap(java.util.Map<? extends java.lang.Long,? extends java.lang.Float> 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 Long2FloatOpenCustomHashMap(Long2FloatMap 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 Long2FloatOpenCustomHashMap(Long2FloatMap 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 float put(long key,
float value)
Long2FloatMapput in interface Long2FloatMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public float putIfAbsent(long key,
float value)
Long2FloatMapputIfAbsent in interface Long2FloatMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public float addTo(long key,
float value)
Long2FloatMapaddTo in interface Long2FloatMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic float subFrom(long key,
float value)
Long2FloatMapLong2FloatMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedsubFrom in interface Long2FloatMapkey - that should be subtract fromvalue - that should be subtractpublic boolean containsKey(long key)
Long2FloatMapcontainsKey in interface Long2FloatMapcontainsKey in class AbstractLong2FloatMapkey - element that is searched for@Deprecated public boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Long,java.lang.Float>containsKey in interface Long2FloatMapcontainsKey in class java.util.AbstractMap<java.lang.Long,java.lang.Float>key - that is searched for.Map.containsKey(Object)public boolean containsValue(float value)
Long2FloatMapcontainsValue in interface Long2FloatMapcontainsValue in class AbstractLong2FloatMapvalue - element that is searched for@Deprecated public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.Long,java.lang.Float>containsValue in interface Long2FloatMapcontainsValue in class java.util.AbstractMap<java.lang.Long,java.lang.Float>value - that is searched for.Map.containsValue(Object)public float remove(long key)
Long2FloatMapremove in interface Long2FloatMapkey - the element that should be removedpublic float removeOrDefault(long key,
float defaultValue)
Long2FloatMapremoveOrDefault in interface Long2FloatMapkey - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)public java.lang.Float remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Long,java.lang.Float>remove in interface Long2FloatMapremove in class AbstractLong2FloatMapkey - the element that should be removedMap.remove(Object)public boolean remove(long key,
float value)
Long2FloatMapremove in interface Long2FloatMapkey - 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)
remove in interface java.util.Map<java.lang.Long,java.lang.Float>remove in interface Long2FloatMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public float get(long key)
Long2FloatMapget in interface Long2FloatFunctionget in interface Long2FloatMapkey - the key that is searched forpublic java.lang.Float get(java.lang.Object key)
get in interface java.util.Map<java.lang.Long,java.lang.Float>get in interface Long2FloatMapget in class AbstractLong2FloatMappublic float getOrDefault(long key,
float defaultValue)
Long2FloatMapgetOrDefault in interface Long2FloatMapgetOrDefault in class AbstractLong2FloatMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic Long2FloatOpenCustomHashMap copy()
Long2FloatMapcopy in interface Long2FloatMapcopy in class AbstractLong2FloatMappublic ObjectSet<Long2FloatMap.Entry> long2FloatEntrySet()
Long2FloatMaplong2FloatEntrySet in interface Long2FloatMappublic LongSet keySet()
keySet in interface java.util.Map<java.lang.Long,java.lang.Float>keySet in interface Long2FloatMapkeySet in class AbstractLong2FloatMappublic FloatCollection values()
values in interface java.util.Map<java.lang.Long,java.lang.Float>values in interface Long2FloatMapvalues in class AbstractLong2FloatMappublic void forEach(LongFloatConsumer action)
Long2FloatMapforEach in interface Long2FloatMapforEach in class AbstractLong2FloatMapaction - processor of the values that are iterator overpublic boolean replace(long key,
float oldValue,
float newValue)
Long2FloatMapreplace in interface Long2FloatMapreplace in class AbstractLong2FloatMapkey - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public float replace(long key,
float value)
Long2FloatMapreplace in interface Long2FloatMapreplace in class AbstractLong2FloatMapkey - the element that should be searched forvalue - the value to replace with.public float computeFloat(long key,
LongFloatUnaryOperator mappingFunction)
Long2FloatMapcomputeFloat in interface Long2FloatMapcomputeFloat in class AbstractLong2FloatMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic float computeFloatIfAbsent(long key,
Long2FloatFunction mappingFunction)
Long2FloatMapcomputeFloatIfAbsent in interface Long2FloatMapcomputeFloatIfAbsent in class AbstractLong2FloatMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic float supplyFloatIfAbsent(long key,
FloatSupplier valueProvider)
Long2FloatMapsupplyFloatIfAbsent in interface Long2FloatMapsupplyFloatIfAbsent in class AbstractLong2FloatMapkey - the key that should be computedvalueProvider - the value if not presentpublic float computeFloatIfPresent(long key,
LongFloatUnaryOperator mappingFunction)
Long2FloatMapcomputeFloatIfPresent in interface Long2FloatMapcomputeFloatIfPresent in class AbstractLong2FloatMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic float mergeFloat(long key,
float value,
FloatFloatUnaryOperator mappingFunction)
Long2FloatMapmergeFloat in interface Long2FloatMapmergeFloat in class AbstractLong2FloatMapkey - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuepublic void mergeAllFloat(Long2FloatMap m, FloatFloatUnaryOperator mappingFunction)
Long2FloatMapmergeAllFloat in interface Long2FloatMapmergeAllFloat in class AbstractLong2FloatMapm - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic int size()
size in interface java.util.Map<java.lang.Long,java.lang.Float>size in class java.util.AbstractMap<java.lang.Long,java.lang.Float>public void clear()
clear in interface java.util.Map<java.lang.Long,java.lang.Float>clear in class java.util.AbstractMap<java.lang.Long,java.lang.Float>public boolean trim(int size)
ITrimmabletrim in interface ITrimmablesize - the requested trim size.public void clearAndTrim(int size)
ITrimmableclearAndTrim in interface ITrimmablesize - the amount of elements that should be allowed