public class Char2FloatOpenHashMap extends AbstractChar2FloatMap implements ITrimmable
AbstractChar2FloatMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Char2FloatMap.BuilderCache, Char2FloatMap.Entry, Char2FloatMap.FastEntrySet, Char2FloatMap.MapBuilder| Constructor and Description |
|---|
Char2FloatOpenHashMap()
Default Constructor
|
Char2FloatOpenHashMap(char[] keys,
float[] values)
Helper constructor that allow to create a map from unboxed values
|
Char2FloatOpenHashMap(char[] keys,
float[] values,
float loadFactor)
Helper constructor that allow to create a map from unboxed values
|
Char2FloatOpenHashMap(Char2FloatMap map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Char2FloatOpenHashMap(Char2FloatMap map,
float loadFactor)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Char2FloatOpenHashMap(java.lang.Character[] keys,
java.lang.Float[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Char2FloatOpenHashMap(java.lang.Character[] keys,
java.lang.Float[] values,
float loadFactor)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Char2FloatOpenHashMap(int minCapacity)
Constructor that defines the minimum capacity
|
Char2FloatOpenHashMap(int minCapacity,
float loadFactor)
Constructor that defines the minimum capacity and load factor
|
Char2FloatOpenHashMap(java.util.Map<? extends java.lang.Character,? extends java.lang.Float> map)
A Helper constructor that allows to create a Map with exactly the same values as the provided map.
|
Char2FloatOpenHashMap(java.util.Map<? extends java.lang.Character,? extends java.lang.Float> map,
float loadFactor)
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(char key,
float value)
A Helper method to add a primitives together.
|
ObjectSet<Char2FloatMap.Entry> |
char2FloatEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
void |
clear() |
void |
clearAndTrim(int size)
Trims the collection down to the requested size and clears all elements while doing so
|
float |
computeFloat(char key,
CharFloatUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
float |
computeFloatIfAbsent(char key,
Char2FloatFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
float |
computeFloatIfPresent(char key,
CharFloatUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(char 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.
|
Char2FloatOpenHashMap |
copy()
A Function that does a shallow clone of the Map itself.
|
void |
forEach(CharFloatConsumer action)
Type Specific forEach method to reduce boxing/unboxing
|
float |
get(char key)
A Type Specific get method to reduce boxing/unboxing
|
java.lang.Float |
get(java.lang.Object key) |
float |
getOrDefault(char key,
float defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
CharSet |
keySet() |
void |
mergeAllFloat(Char2FloatMap m,
FloatFloatUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
float |
mergeFloat(char key,
float value,
FloatFloatUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
float |
put(char key,
float value)
Type Specific method to reduce boxing/unboxing of values
|
float |
putIfAbsent(char key,
float value)
Type Specific method to reduce boxing/unboxing of values
|
float |
remove(char key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(char 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(char key,
float defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
float |
replace(char key,
float value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(char key,
float oldValue,
float newValue)
A Type Specific replace method to replace an existing value
|
int |
size() |
float |
subFrom(char key,
float value)
A Helper method to subtract from primitive from each other.
|
float |
supplyFloatIfAbsent(char 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, trimapplyAsFloat, builder, compute, computeIfAbsent, computeIfPresent, forEach, merge, put, put, putAll, putAll, putIfAbsent, replace, replace, replaceAll, synchronize, synchronize, unmodifiablepublic Char2FloatOpenHashMap()
public Char2FloatOpenHashMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Char2FloatOpenHashMap(int minCapacity,
float loadFactor)
minCapacity - the minimum capacity the HashMap is allowed to be.loadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the minimum capacity is negativejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public Char2FloatOpenHashMap(java.lang.Character[] keys,
java.lang.Float[] values)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.java.lang.IllegalStateException - if the keys and values do not match in lenghtpublic Char2FloatOpenHashMap(java.lang.Character[] keys,
java.lang.Float[] values,
float loadFactor)
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 resizejava.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 Char2FloatOpenHashMap(char[] keys,
float[] values)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.java.lang.IllegalStateException - if the keys and values do not match in lenghtpublic Char2FloatOpenHashMap(char[] keys,
float[] values,
float loadFactor)
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 resizejava.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 Char2FloatOpenHashMap(java.util.Map<? extends java.lang.Character,? extends java.lang.Float> map)
map - the values that should be present in the mappublic Char2FloatOpenHashMap(java.util.Map<? extends java.lang.Character,? extends java.lang.Float> map,
float loadFactor)
map - the values that should be present in the maploadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public Char2FloatOpenHashMap(Char2FloatMap map)
map - the values that should be present in the mappublic Char2FloatOpenHashMap(Char2FloatMap map, float loadFactor)
map - the values that should be present in the maploadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public float put(char key,
float value)
Char2FloatMapput in interface Char2FloatMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public float putIfAbsent(char key,
float value)
Char2FloatMapputIfAbsent in interface Char2FloatMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public float addTo(char key,
float value)
Char2FloatMapaddTo in interface Char2FloatMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic float subFrom(char key,
float value)
Char2FloatMapChar2FloatMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedsubFrom in interface Char2FloatMapkey - that should be subtract fromvalue - that should be subtractpublic boolean containsKey(char key)
Char2FloatMapcontainsKey in interface Char2FloatMapcontainsKey in class AbstractChar2FloatMapkey - element that is searched for@Deprecated public boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Character,java.lang.Float>containsKey in interface Char2FloatMapcontainsKey in class java.util.AbstractMap<java.lang.Character,java.lang.Float>key - that is searched for.Map.containsKey(Object)public boolean containsValue(float value)
Char2FloatMapcontainsValue in interface Char2FloatMapcontainsValue in class AbstractChar2FloatMapvalue - element that is searched for@Deprecated public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.Character,java.lang.Float>containsValue in interface Char2FloatMapcontainsValue in class java.util.AbstractMap<java.lang.Character,java.lang.Float>value - that is searched for.Map.containsValue(Object)public float remove(char key)
Char2FloatMapremove in interface Char2FloatMapkey - the element that should be removedpublic float removeOrDefault(char key,
float defaultValue)
Char2FloatMapremoveOrDefault in interface Char2FloatMapkey - 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.Character,java.lang.Float>remove in interface Char2FloatMapremove in class AbstractChar2FloatMapkey - the element that should be removedMap.remove(Object)public boolean remove(char key,
float value)
Char2FloatMapremove in interface Char2FloatMapkey - 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.Character,java.lang.Float>remove in interface Char2FloatMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public float get(char key)
Char2FloatMapget in interface Char2FloatMapkey - the key that is searched forpublic java.lang.Float get(java.lang.Object key)
get in interface java.util.Map<java.lang.Character,java.lang.Float>get in interface Char2FloatMapget in class AbstractChar2FloatMappublic float getOrDefault(char key,
float defaultValue)
Char2FloatMapgetOrDefault in interface Char2FloatMapgetOrDefault in class AbstractChar2FloatMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic Char2FloatOpenHashMap copy()
Char2FloatMapcopy in interface Char2FloatMapcopy in class AbstractChar2FloatMappublic ObjectSet<Char2FloatMap.Entry> char2FloatEntrySet()
Char2FloatMapchar2FloatEntrySet in interface Char2FloatMappublic CharSet keySet()
keySet in interface java.util.Map<java.lang.Character,java.lang.Float>keySet in interface Char2FloatMapkeySet in class AbstractChar2FloatMappublic FloatCollection values()
values in interface java.util.Map<java.lang.Character,java.lang.Float>values in interface Char2FloatMapvalues in class AbstractChar2FloatMappublic void forEach(CharFloatConsumer action)
Char2FloatMapforEach in interface Char2FloatMapforEach in class AbstractChar2FloatMapaction - processor of the values that are iterator overpublic boolean replace(char key,
float oldValue,
float newValue)
Char2FloatMapreplace in interface Char2FloatMapreplace in class AbstractChar2FloatMapkey - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public float replace(char key,
float value)
Char2FloatMapreplace in interface Char2FloatMapreplace in class AbstractChar2FloatMapkey - the element that should be searched forvalue - the value to replace with.public float computeFloat(char key,
CharFloatUnaryOperator mappingFunction)
Char2FloatMapcomputeFloat in interface Char2FloatMapcomputeFloat in class AbstractChar2FloatMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic float computeFloatIfAbsent(char key,
Char2FloatFunction mappingFunction)
Char2FloatMapcomputeFloatIfAbsent in interface Char2FloatMapcomputeFloatIfAbsent in class AbstractChar2FloatMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic float supplyFloatIfAbsent(char key,
FloatSupplier valueProvider)
Char2FloatMapsupplyFloatIfAbsent in interface Char2FloatMapsupplyFloatIfAbsent in class AbstractChar2FloatMapkey - the key that should be computedvalueProvider - the value if not presentpublic float computeFloatIfPresent(char key,
CharFloatUnaryOperator mappingFunction)
Char2FloatMapcomputeFloatIfPresent in interface Char2FloatMapcomputeFloatIfPresent in class AbstractChar2FloatMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic float mergeFloat(char key,
float value,
FloatFloatUnaryOperator mappingFunction)
Char2FloatMapmergeFloat in interface Char2FloatMapmergeFloat in class AbstractChar2FloatMapkey - 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(Char2FloatMap m, FloatFloatUnaryOperator mappingFunction)
Char2FloatMapmergeAllFloat in interface Char2FloatMapmergeAllFloat in class AbstractChar2FloatMapm - 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.Character,java.lang.Float>size in class java.util.AbstractMap<java.lang.Character,java.lang.Float>public void clear()
clear in interface java.util.Map<java.lang.Character,java.lang.Float>clear in class java.util.AbstractMap<java.lang.Character,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