public class Int2FloatArrayMap extends AbstractInt2FloatMap implements Int2FloatOrderedMap
AbstractInt2FloatMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Int2FloatOrderedMap.FastOrderedSetInt2FloatMap.BuilderCache, Int2FloatMap.Entry, Int2FloatMap.FastEntrySet, Int2FloatMap.MapBuilder| Constructor and Description |
|---|
Int2FloatArrayMap()
Default Constructor
|
Int2FloatArrayMap(int minCapacity)
Constructor that defines the minimum capacity
|
Int2FloatArrayMap(int[] keys,
float[] values)
Helper constructor that allow to create a map from unboxed values
|
Int2FloatArrayMap(int[] keys,
float[] values,
int length)
Helper constructor that allow to create a map from unboxed values
|
Int2FloatArrayMap(Int2FloatMap map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Int2FloatArrayMap(java.lang.Integer[] keys,
java.lang.Float[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Int2FloatArrayMap(java.lang.Integer[] 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
|
Int2FloatArrayMap(java.util.Map<? extends java.lang.Integer,? 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(int key,
float value)
A Helper method to add a primitives together.
|
void |
clear() |
float |
computeFloat(int key,
IntFloatUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
float |
computeFloatIfAbsent(int key,
Int2FloatFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
float |
computeFloatIfPresent(int key,
IntFloatUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(int 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) |
Int2FloatArrayMap |
copy()
A Function that does a shallow clone of the Map itself.
|
float |
firstFloatValue()
A method to get the first Value of a Map.
|
int |
firstIntKey()
A method to get the first Key of a Map.
|
void |
forEach(IntFloatConsumer action)
Type Specific forEach method to reduce boxing/unboxing
|
float |
get(int key)
A Type Specific get method to reduce boxing/unboxing
|
float |
getAndMoveToFirst(int key)
A Specific get method that allows to move teh given key/value int the first index.
|
float |
getAndMoveToLast(int key)
A Specific get method that allows to move teh given key/value int the last index.
|
float |
getOrDefault(int key,
float defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
ObjectOrderedSet<Int2FloatMap.Entry> |
int2FloatEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
IntOrderedSet |
keySet() |
float |
lastFloatValue()
A method to get the last Value of a Map.
|
int |
lastIntKey()
A method to get the last Key of a Map.
|
void |
mergeAllFloat(Int2FloatMap m,
FloatFloatUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
float |
mergeFloat(int key,
float value,
FloatFloatUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
boolean |
moveToFirst(int key)
A specific move method to move a given key/value to the first index.
|
boolean |
moveToLast(int key)
A specific move method to move a given key/value to the last index.
|
int |
pollFirstIntKey()
A method to get and remove the first Key of a Map.
|
int |
pollLastIntKey()
A method to get and remove the last Key of a Map.
|
float |
put(int key,
float value)
Type Specific method to reduce boxing/unboxing of values
|
float |
putAndMoveToFirst(int key,
float value)
A customized put method that allows you to insert into the first index.
|
float |
putAndMoveToLast(int key,
float value)
A customized put method that allows you to insert into the last index.
|
float |
putIfAbsent(int key,
float value)
Type Specific method to reduce boxing/unboxing of values
|
float |
remove(int key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(int 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(int key,
float defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
float |
replace(int key,
float value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(int key,
float oldValue,
float newValue)
A Type Specific replace method to replace an existing value
|
int |
size() |
float |
subFrom(int key,
float value)
A Helper method to subtract from primitive from each other.
|
float |
supplyFloatIfAbsent(int 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, applyAsFloat, builder, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, put, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, replace, replace, replaceAll, replaceFloats, replaceFloats, setDefaultReturnValuepublic Int2FloatArrayMap()
public Int2FloatArrayMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Int2FloatArrayMap(java.lang.Integer[] 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 Int2FloatArrayMap(java.lang.Integer[] 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 Int2FloatArrayMap(int[] 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 Int2FloatArrayMap(int[] 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 Int2FloatArrayMap(java.util.Map<? extends java.lang.Integer,? extends java.lang.Float> map)
map - the values that should be present in the mappublic Int2FloatArrayMap(Int2FloatMap map)
map - the values that should be present in the mappublic float put(int key,
float value)
Int2FloatMapput in interface Int2FloatMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public float putIfAbsent(int key,
float value)
Int2FloatMapputIfAbsent in interface Int2FloatMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public float addTo(int key,
float value)
Int2FloatMapaddTo in interface Int2FloatMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic float subFrom(int key,
float value)
Int2FloatMapInt2FloatMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedsubFrom in interface Int2FloatMapkey - that should be subtract fromvalue - that should be subtractpublic float putAndMoveToFirst(int key,
float value)
Int2FloatOrderedMapputAndMoveToFirst in interface Int2FloatOrderedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public float putAndMoveToLast(int key,
float value)
Int2FloatOrderedMapputAndMoveToLast in interface Int2FloatOrderedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(int key)
Int2FloatOrderedMapmoveToFirst in interface Int2FloatOrderedMapkey - that should be moved to the first indexpublic boolean moveToLast(int key)
Int2FloatOrderedMapmoveToLast in interface Int2FloatOrderedMapkey - that should be moved to the first lastpublic boolean containsKey(int key)
Int2FloatMapcontainsKey in interface Int2FloatMapcontainsKey in class AbstractInt2FloatMapkey - element that is searched forpublic boolean containsValue(float value)
Int2FloatMapcontainsValue in interface Int2FloatMapcontainsValue in class AbstractInt2FloatMapvalue - element that is searched forpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Integer,java.lang.Float>containsKey in interface Int2FloatMapcontainsKey in class java.util.AbstractMap<java.lang.Integer,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.Integer,java.lang.Float>containsValue in interface Int2FloatMapcontainsValue in class java.util.AbstractMap<java.lang.Integer,java.lang.Float>value - that is searched for.Map.containsValue(Object)public float get(int key)
Int2FloatMapget in interface Int2FloatMapkey - the key that is searched forpublic float getOrDefault(int key,
float defaultValue)
Int2FloatMapgetOrDefault in interface Int2FloatMapgetOrDefault in class AbstractInt2FloatMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic float getAndMoveToFirst(int key)
Int2FloatOrderedMapgetAndMoveToFirst in interface Int2FloatOrderedMapkey - that is searched forpublic float getAndMoveToLast(int key)
Int2FloatOrderedMapgetAndMoveToLast in interface Int2FloatOrderedMapkey - that is searched forpublic int firstIntKey()
Int2FloatOrderedMapfirstIntKey in interface Int2FloatOrderedMappublic int lastIntKey()
Int2FloatOrderedMaplastIntKey in interface Int2FloatOrderedMappublic float firstFloatValue()
Int2FloatOrderedMapfirstFloatValue in interface Int2FloatOrderedMappublic float lastFloatValue()
Int2FloatOrderedMaplastFloatValue in interface Int2FloatOrderedMappublic int pollFirstIntKey()
Int2FloatOrderedMappollFirstIntKey in interface Int2FloatOrderedMappublic int pollLastIntKey()
Int2FloatOrderedMappollLastIntKey in interface Int2FloatOrderedMappublic float remove(int key)
Int2FloatMapremove in interface Int2FloatMapkey - the element that should be removedpublic float removeOrDefault(int key,
float defaultValue)
Int2FloatMapremoveOrDefault in interface Int2FloatMapkey - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)public boolean remove(int key,
float value)
Int2FloatMapremove in interface Int2FloatMapkey - 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.Integer,java.lang.Float>remove in interface Int2FloatMapremove in class AbstractInt2FloatMapkey - 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.Integer,java.lang.Float>remove in interface Int2FloatMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public void forEach(IntFloatConsumer action)
Int2FloatMapforEach in interface Int2FloatMapforEach in class AbstractInt2FloatMapaction - processor of the values that are iterator overpublic IntOrderedSet keySet()
keySet in interface java.util.Map<java.lang.Integer,java.lang.Float>keySet in interface Int2FloatMapkeySet in interface Int2FloatOrderedMapkeySet in class AbstractInt2FloatMappublic FloatCollection values()
values in interface java.util.Map<java.lang.Integer,java.lang.Float>values in interface Int2FloatMapvalues in class AbstractInt2FloatMappublic ObjectOrderedSet<Int2FloatMap.Entry> int2FloatEntrySet()
Int2FloatMapint2FloatEntrySet in interface Int2FloatMapint2FloatEntrySet in interface Int2FloatOrderedMappublic boolean replace(int key,
float oldValue,
float newValue)
Int2FloatMapreplace in interface Int2FloatMapreplace in class AbstractInt2FloatMapkey - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public float replace(int key,
float value)
Int2FloatMapreplace in interface Int2FloatMapreplace in class AbstractInt2FloatMapkey - the element that should be searched forvalue - the value to replace with.public float computeFloat(int key,
IntFloatUnaryOperator mappingFunction)
Int2FloatMapcomputeFloat in interface Int2FloatMapcomputeFloat in class AbstractInt2FloatMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic float computeFloatIfAbsent(int key,
Int2FloatFunction mappingFunction)
Int2FloatMapcomputeFloatIfAbsent in interface Int2FloatMapcomputeFloatIfAbsent in class AbstractInt2FloatMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic float supplyFloatIfAbsent(int key,
FloatSupplier valueProvider)
Int2FloatMapsupplyFloatIfAbsent in interface Int2FloatMapsupplyFloatIfAbsent in class AbstractInt2FloatMapkey - the key that should be computedvalueProvider - the value if not presentpublic float computeFloatIfPresent(int key,
IntFloatUnaryOperator mappingFunction)
Int2FloatMapcomputeFloatIfPresent in interface Int2FloatMapcomputeFloatIfPresent in class AbstractInt2FloatMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic float mergeFloat(int key,
float value,
FloatFloatUnaryOperator mappingFunction)
Int2FloatMapmergeFloat in interface Int2FloatMapmergeFloat in class AbstractInt2FloatMapkey - 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(Int2FloatMap m, FloatFloatUnaryOperator mappingFunction)
Int2FloatMapmergeAllFloat in interface Int2FloatMapmergeAllFloat in class AbstractInt2FloatMapm - 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.Integer,java.lang.Float>size in class java.util.AbstractMap<java.lang.Integer,java.lang.Float>public void clear()
clear in interface java.util.Map<java.lang.Integer,java.lang.Float>clear in class java.util.AbstractMap<java.lang.Integer,java.lang.Float>public Int2FloatArrayMap copy()
Int2FloatMapcopy in interface Int2FloatMapcopy in interface Int2FloatOrderedMapcopy in class AbstractInt2FloatMap