public class Double2FloatOpenCustomHashMap extends AbstractDouble2FloatMap implements ITrimmable
AbstractDouble2FloatMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Double2FloatMap.BuilderCache, Double2FloatMap.Entry, Double2FloatMap.FastEntrySet, Double2FloatMap.MapBuilder| Constructor and Description |
|---|
Double2FloatOpenCustomHashMap(double[] keys,
float[] values,
DoubleStrategy strategy)
Helper constructor that allow to create a map from unboxed values
|
Double2FloatOpenCustomHashMap(java.lang.Double[] keys,
java.lang.Float[] values,
DoubleStrategy strategy)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Double2FloatOpenCustomHashMap(double[] keys,
float[] values,
float loadFactor,
DoubleStrategy strategy)
Helper constructor that allow to create a map from unboxed values
|
Double2FloatOpenCustomHashMap(java.lang.Double[] keys,
java.lang.Float[] values,
float loadFactor,
DoubleStrategy strategy)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Double2FloatOpenCustomHashMap(Double2FloatMap map,
DoubleStrategy strategy)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Double2FloatOpenCustomHashMap(Double2FloatMap map,
float loadFactor,
DoubleStrategy strategy)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Double2FloatOpenCustomHashMap(DoubleStrategy strategy)
Default Contstructor
|
Double2FloatOpenCustomHashMap(int minCapacity,
DoubleStrategy strategy)
Constructor that defines the minimum capacity
|
Double2FloatOpenCustomHashMap(int minCapacity,
float loadFactor,
DoubleStrategy strategy)
Constructor that defines the minimum capacity and load factor
|
Double2FloatOpenCustomHashMap(java.util.Map<? extends java.lang.Double,? extends java.lang.Float> map,
DoubleStrategy strategy)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Double2FloatOpenCustomHashMap(java.util.Map<? extends java.lang.Double,? extends java.lang.Float> map,
float loadFactor,
DoubleStrategy 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(double 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(double key,
DoubleFloatUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
float |
computeFloatIfAbsent(double key,
Double2FloatFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
float |
computeFloatIfPresent(double key,
DoubleFloatUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(double 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.
|
Double2FloatOpenCustomHashMap |
copy()
A Function that does a shallow clone of the Map itself.
|
ObjectSet<Double2FloatMap.Entry> |
double2FloatEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
void |
forEach(DoubleFloatConsumer action)
Type Specific forEach method to reduce boxing/unboxing
|
float |
get(double key)
A Type Specific get method to reduce boxing/unboxing
|
java.lang.Float |
get(java.lang.Object key) |
float |
getOrDefault(double key,
float defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
DoubleSet |
keySet() |
void |
mergeAllFloat(Double2FloatMap m,
FloatFloatUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
float |
mergeFloat(double key,
float value,
FloatFloatUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
float |
put(double key,
float value)
Type Specific method to reduce boxing/unboxing of values
|
float |
putIfAbsent(double key,
float value)
Type Specific method to reduce boxing/unboxing of values
|
float |
remove(double key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(double 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(double key,
float defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
float |
replace(double key,
float value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(double key,
float oldValue,
float newValue)
A Type Specific replace method to replace an existing value
|
int |
size() |
float |
subFrom(double key,
float value)
A Helper method to subtract from primitive from each other.
|
float |
supplyFloatIfAbsent(double 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 Double2FloatOpenCustomHashMap(DoubleStrategy strategy)
strategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nullpublic Double2FloatOpenCustomHashMap(int minCapacity,
DoubleStrategy 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 Double2FloatOpenCustomHashMap(int minCapacity,
float loadFactor,
DoubleStrategy 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 Double2FloatOpenCustomHashMap(java.lang.Double[] keys,
java.lang.Float[] values,
DoubleStrategy 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 Double2FloatOpenCustomHashMap(java.lang.Double[] keys,
java.lang.Float[] values,
float loadFactor,
DoubleStrategy 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 Double2FloatOpenCustomHashMap(double[] keys,
float[] values,
DoubleStrategy 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 Double2FloatOpenCustomHashMap(double[] keys,
float[] values,
float loadFactor,
DoubleStrategy 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 Double2FloatOpenCustomHashMap(java.util.Map<? extends java.lang.Double,? extends java.lang.Float> map,
DoubleStrategy strategy)
map - the values that should be present in the mapstrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nullpublic Double2FloatOpenCustomHashMap(java.util.Map<? extends java.lang.Double,? extends java.lang.Float> map,
float loadFactor,
DoubleStrategy 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 Double2FloatOpenCustomHashMap(Double2FloatMap map, DoubleStrategy strategy)
map - the values that should be present in the mapstrategy - the strategy that allows hash control.java.lang.NullPointerException - if Strategy is nullpublic Double2FloatOpenCustomHashMap(Double2FloatMap map, float loadFactor, DoubleStrategy 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(double key,
float value)
Double2FloatMapput in interface Double2FloatMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public float putIfAbsent(double key,
float value)
Double2FloatMapputIfAbsent in interface Double2FloatMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public float addTo(double key,
float value)
Double2FloatMapaddTo in interface Double2FloatMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic float subFrom(double key,
float value)
Double2FloatMapDouble2FloatMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedsubFrom in interface Double2FloatMapkey - that should be subtract fromvalue - that should be subtractpublic boolean containsKey(double key)
Double2FloatMapcontainsKey in interface Double2FloatMapcontainsKey in class AbstractDouble2FloatMapkey - element that is searched for@Deprecated public boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Double,java.lang.Float>containsKey in interface Double2FloatMapcontainsKey in class java.util.AbstractMap<java.lang.Double,java.lang.Float>key - that is searched for.Map.containsKey(Object)public boolean containsValue(float value)
Double2FloatMapcontainsValue in interface Double2FloatMapcontainsValue in class AbstractDouble2FloatMapvalue - element that is searched for@Deprecated public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.Double,java.lang.Float>containsValue in interface Double2FloatMapcontainsValue in class java.util.AbstractMap<java.lang.Double,java.lang.Float>value - that is searched for.Map.containsValue(Object)public float remove(double key)
Double2FloatMapremove in interface Double2FloatMapkey - the element that should be removedpublic float removeOrDefault(double key,
float defaultValue)
Double2FloatMapremoveOrDefault in interface Double2FloatMapkey - 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.Double,java.lang.Float>remove in interface Double2FloatMapremove in class AbstractDouble2FloatMapkey - the element that should be removedMap.remove(Object)public boolean remove(double key,
float value)
Double2FloatMapremove in interface Double2FloatMapkey - 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.Double,java.lang.Float>remove in interface Double2FloatMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public float get(double key)
Double2FloatMapget in interface Double2FloatFunctionget in interface Double2FloatMapkey - the key that is searched forpublic java.lang.Float get(java.lang.Object key)
get in interface java.util.Map<java.lang.Double,java.lang.Float>get in interface Double2FloatMapget in class AbstractDouble2FloatMappublic float getOrDefault(double key,
float defaultValue)
Double2FloatMapgetOrDefault in interface Double2FloatMapgetOrDefault in class AbstractDouble2FloatMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic Double2FloatOpenCustomHashMap copy()
Double2FloatMapcopy in interface Double2FloatMapcopy in class AbstractDouble2FloatMappublic ObjectSet<Double2FloatMap.Entry> double2FloatEntrySet()
Double2FloatMapdouble2FloatEntrySet in interface Double2FloatMappublic DoubleSet keySet()
keySet in interface java.util.Map<java.lang.Double,java.lang.Float>keySet in interface Double2FloatMapkeySet in class AbstractDouble2FloatMappublic FloatCollection values()
values in interface java.util.Map<java.lang.Double,java.lang.Float>values in interface Double2FloatMapvalues in class AbstractDouble2FloatMappublic void forEach(DoubleFloatConsumer action)
Double2FloatMapforEach in interface Double2FloatMapforEach in class AbstractDouble2FloatMapaction - processor of the values that are iterator overpublic boolean replace(double key,
float oldValue,
float newValue)
Double2FloatMapreplace in interface Double2FloatMapreplace in class AbstractDouble2FloatMapkey - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public float replace(double key,
float value)
Double2FloatMapreplace in interface Double2FloatMapreplace in class AbstractDouble2FloatMapkey - the element that should be searched forvalue - the value to replace with.public float computeFloat(double key,
DoubleFloatUnaryOperator mappingFunction)
Double2FloatMapcomputeFloat in interface Double2FloatMapcomputeFloat in class AbstractDouble2FloatMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic float computeFloatIfAbsent(double key,
Double2FloatFunction mappingFunction)
Double2FloatMapcomputeFloatIfAbsent in interface Double2FloatMapcomputeFloatIfAbsent in class AbstractDouble2FloatMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic float supplyFloatIfAbsent(double key,
FloatSupplier valueProvider)
Double2FloatMapsupplyFloatIfAbsent in interface Double2FloatMapsupplyFloatIfAbsent in class AbstractDouble2FloatMapkey - the key that should be computedvalueProvider - the value if not presentpublic float computeFloatIfPresent(double key,
DoubleFloatUnaryOperator mappingFunction)
Double2FloatMapcomputeFloatIfPresent in interface Double2FloatMapcomputeFloatIfPresent in class AbstractDouble2FloatMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic float mergeFloat(double key,
float value,
FloatFloatUnaryOperator mappingFunction)
Double2FloatMapmergeFloat in interface Double2FloatMapmergeFloat in class AbstractDouble2FloatMapkey - 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(Double2FloatMap m, FloatFloatUnaryOperator mappingFunction)
Double2FloatMapmergeAllFloat in interface Double2FloatMapmergeAllFloat in class AbstractDouble2FloatMapm - 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.Double,java.lang.Float>size in class java.util.AbstractMap<java.lang.Double,java.lang.Float>public void clear()
clear in interface java.util.Map<java.lang.Double,java.lang.Float>clear in class java.util.AbstractMap<java.lang.Double,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