public class Char2FloatArrayMap extends AbstractChar2FloatMap implements Char2FloatOrderedMap
AbstractChar2FloatMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Char2FloatOrderedMap.FastOrderedSetChar2FloatMap.BuilderCache, Char2FloatMap.Entry, Char2FloatMap.FastEntrySet, Char2FloatMap.MapBuilder| Constructor and Description |
|---|
Char2FloatArrayMap()
Default Constructor
|
Char2FloatArrayMap(char[] keys,
float[] values)
Helper constructor that allow to create a map from unboxed values
|
Char2FloatArrayMap(char[] keys,
float[] values,
int length)
Helper constructor that allow to create a map from unboxed values
|
Char2FloatArrayMap(Char2FloatMap map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Char2FloatArrayMap(java.lang.Character[] keys,
java.lang.Float[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Char2FloatArrayMap(java.lang.Character[] keys,
java.lang.Float[] values,
int length)
Helper constructor that allow to create a map from boxed values (it will unbox them) with a custom length
|
Char2FloatArrayMap(int minCapacity)
Constructor that defines the minimum capacity
|
Char2FloatArrayMap(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.
|
| Modifier and Type | Method and Description |
|---|---|
float |
addTo(char key,
float value)
A Helper method to add a primitives together.
|
ObjectOrderedSet<Char2FloatMap.Entry> |
char2FloatEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
void |
clear() |
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) |
boolean |
containsValue(float value)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsValue(java.lang.Object value) |
Char2FloatArrayMap |
copy()
A Function that does a shallow clone of the Map itself.
|
char |
firstCharKey()
A method to get the first Key of a Map.
|
float |
firstFloatValue()
A method to get the first Value of a Map.
|
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
|
float |
getAndMoveToFirst(char key)
A Specific get method that allows to move teh given key/value int the first index.
|
float |
getAndMoveToLast(char key)
A Specific get method that allows to move teh given key/value int the last index.
|
float |
getOrDefault(char key,
float defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
CharOrderedSet |
keySet() |
char |
lastCharKey()
A method to get the last Key of a Map.
|
float |
lastFloatValue()
A method to get the last Value of a Map.
|
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
|
boolean |
moveToFirst(char key)
A specific move method to move a given key/value to the first index.
|
boolean |
moveToLast(char key)
A specific move method to move a given key/value to the last index.
|
char |
pollFirstCharKey()
A method to get and remove the first Key of a Map.
|
char |
pollLastCharKey()
A method to get and remove the last Key of a Map.
|
float |
put(char key,
float value)
Type Specific method to reduce boxing/unboxing of values
|
float |
putAndMoveToFirst(char key,
float value)
A customized put method that allows you to insert into the first index.
|
float |
putAndMoveToLast(char key,
float value)
A customized put method that allows you to insert into the last index.
|
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
|
FloatCollection |
values() |
addToAll, entrySet, equals, get, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, replaceFloats, replaceFloats, setDefaultReturnValuesynchronize, synchronize, unmodifiableaddToAll, builder, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, replace, replace, replaceAll, replaceFloats, replaceFloats, setDefaultReturnValuepublic Char2FloatArrayMap()
public Char2FloatArrayMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Char2FloatArrayMap(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 lengthpublic Char2FloatArrayMap(java.lang.Character[] keys,
java.lang.Float[] values,
int length)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.length - the amount of values that should be pulled from the arrayjava.lang.IllegalStateException - if the keys and values do not match in lengthpublic Char2FloatArrayMap(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 Char2FloatArrayMap(char[] keys,
float[] values,
int length)
keys - the keys that should be put into the mapvalues - the values that should be put into the map.length - the amount of values that should be pulled from the arrayjava.lang.IllegalStateException - if the keys and values do not match in lenghtpublic Char2FloatArrayMap(java.util.Map<? extends java.lang.Character,? extends java.lang.Float> map)
map - the values that should be present in the mappublic Char2FloatArrayMap(Char2FloatMap map)
map - the values that should be present in the mappublic 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 float putAndMoveToFirst(char key,
float value)
Char2FloatOrderedMapputAndMoveToFirst in interface Char2FloatOrderedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public float putAndMoveToLast(char key,
float value)
Char2FloatOrderedMapputAndMoveToLast in interface Char2FloatOrderedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(char key)
Char2FloatOrderedMapmoveToFirst in interface Char2FloatOrderedMapkey - that should be moved to the first indexpublic boolean moveToLast(char key)
Char2FloatOrderedMapmoveToLast in interface Char2FloatOrderedMapkey - that should be moved to the first lastpublic boolean containsKey(char key)
Char2FloatMapcontainsKey in interface Char2FloatMapcontainsKey in class AbstractChar2FloatMapkey - element that is searched forpublic boolean containsValue(float value)
Char2FloatMapcontainsValue in interface Char2FloatMapcontainsValue in class AbstractChar2FloatMapvalue - element that is searched forpublic 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(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 get(char key)
Char2FloatMapget in interface Char2FloatFunctionget in interface Char2FloatMapkey - the key that is searched forpublic 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 float getAndMoveToFirst(char key)
Char2FloatOrderedMapgetAndMoveToFirst in interface Char2FloatOrderedMapkey - that is searched forpublic float getAndMoveToLast(char key)
Char2FloatOrderedMapgetAndMoveToLast in interface Char2FloatOrderedMapkey - that is searched forpublic char firstCharKey()
Char2FloatOrderedMapfirstCharKey in interface Char2FloatOrderedMappublic char lastCharKey()
Char2FloatOrderedMaplastCharKey in interface Char2FloatOrderedMappublic float firstFloatValue()
Char2FloatOrderedMapfirstFloatValue in interface Char2FloatOrderedMappublic float lastFloatValue()
Char2FloatOrderedMaplastFloatValue in interface Char2FloatOrderedMappublic char pollFirstCharKey()
Char2FloatOrderedMappollFirstCharKey in interface Char2FloatOrderedMappublic char pollLastCharKey()
Char2FloatOrderedMappollLastCharKey in interface Char2FloatOrderedMappublic 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 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 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(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 void forEach(CharFloatConsumer action)
Char2FloatMapforEach in interface Char2FloatMapforEach in class AbstractChar2FloatMapaction - processor of the values that are iterator overpublic CharOrderedSet keySet()
keySet in interface java.util.Map<java.lang.Character,java.lang.Float>keySet in interface Char2FloatMapkeySet in interface Char2FloatOrderedMapkeySet in class AbstractChar2FloatMappublic FloatCollection values()
values in interface java.util.Map<java.lang.Character,java.lang.Float>values in interface Char2FloatMapvalues in class AbstractChar2FloatMappublic ObjectOrderedSet<Char2FloatMap.Entry> char2FloatEntrySet()
Char2FloatMapchar2FloatEntrySet in interface Char2FloatMapchar2FloatEntrySet in interface Char2FloatOrderedMappublic 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 Char2FloatArrayMap copy()
Char2FloatMapcopy in interface Char2FloatMapcopy in interface Char2FloatOrderedMapcopy in class AbstractChar2FloatMap