public class Int2FloatArrayMap extends AbstractInt2FloatMap implements Int2FloatSortedMap
AbstractInt2FloatMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Int2FloatSortedMap.FastSortedSetInt2FloatMap.Entry, Int2FloatMap.FastEntrySet| 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() |
IntComparator |
comparator() |
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) |
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 |
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 |
getFloat(int key)
A Type Specific get method to reduce boxing/unboxing
|
float |
getOrDefault(int key,
float defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
Int2FloatSortedMap |
headMap(int toKey)
A Type Specific HeadMap method to reduce boxing/unboxing
|
ObjectSortedSet<Int2FloatMap.Entry> |
int2FloatEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
IntSet |
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 |
remInt(int key)
Type Specific remove function to reduce boxing/unboxing
|
float |
remIntOrDefault(int key,
float defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
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 |
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() |
Int2FloatSortedMap |
subMap(int fromKey,
int toKey)
A Type Specific SubMap method to reduce boxing/unboxing
|
Int2FloatSortedMap |
tailMap(int fromKey)
A Type Specific TailMap method to reduce boxing/unboxing
|
FloatCollection |
values() |
addToAll, entrySet, equals, get, getDefaultReturnValue, getOrDefault, hashCode, putAll, putAll, putAll, putAllIfAbsent, replaceFloats, replaceFloats, setDefaultReturnValuefirstKey, headMap, lastKey, subMap, tailMapaddToAll, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, 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 putAndMoveToFirst(int key,
float value)
Int2FloatSortedMapputAndMoveToFirst in interface Int2FloatSortedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public float putAndMoveToLast(int key,
float value)
Int2FloatSortedMapputAndMoveToLast in interface Int2FloatSortedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(int key)
Int2FloatSortedMapmoveToFirst in interface Int2FloatSortedMapkey - that should be moved to the first indexpublic boolean moveToLast(int key)
Int2FloatSortedMapmoveToLast in interface Int2FloatSortedMapkey - 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 getFloat(int key)
Int2FloatMapgetFloat in interface Int2FloatFunctiongetFloat 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)
Int2FloatSortedMapgetAndMoveToFirst in interface Int2FloatSortedMapkey - that is searched forpublic float getAndMoveToLast(int key)
Int2FloatSortedMapgetAndMoveToLast in interface Int2FloatSortedMapkey - that is searched forpublic int firstIntKey()
Int2FloatSortedMapfirstIntKey in interface Int2FloatSortedMappublic int lastIntKey()
Int2FloatSortedMaplastIntKey in interface Int2FloatSortedMappublic float firstFloatValue()
Int2FloatSortedMapfirstFloatValue in interface Int2FloatSortedMappublic float lastFloatValue()
Int2FloatSortedMaplastFloatValue in interface Int2FloatSortedMappublic int pollFirstIntKey()
Int2FloatSortedMappollFirstIntKey in interface Int2FloatSortedMappublic int pollLastIntKey()
Int2FloatSortedMappollLastIntKey in interface Int2FloatSortedMappublic float remInt(int key)
Int2FloatMapremInt in interface Int2FloatMapkey - the element that should be removedpublic float remIntOrDefault(int key,
float defaultValue)
Int2FloatMapremIntOrDefault 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 java.util.AbstractMap<java.lang.Integer,java.lang.Float>key - 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 IntSet keySet()
keySet in interface java.util.Map<java.lang.Integer,java.lang.Float>keySet in interface java.util.SortedMap<java.lang.Integer,java.lang.Float>keySet in interface Int2FloatMapkeySet in interface Int2FloatSortedMapkeySet in class AbstractInt2FloatMappublic FloatCollection values()
values in interface java.util.Map<java.lang.Integer,java.lang.Float>values in interface java.util.SortedMap<java.lang.Integer,java.lang.Float>values in interface Int2FloatMapvalues in interface Int2FloatSortedMapvalues in class AbstractInt2FloatMappublic ObjectSortedSet<Int2FloatMap.Entry> int2FloatEntrySet()
Int2FloatMapint2FloatEntrySet in interface Int2FloatMappublic 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 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 IntComparator comparator()
comparator in interface java.util.SortedMap<java.lang.Integer,java.lang.Float>comparator in interface Int2FloatSortedMappublic Int2FloatSortedMap subMap(int fromKey, int toKey)
Int2FloatSortedMapsubMap in interface Int2FloatSortedMapfromKey - where the submap should starttoKey - where the subMap should endpublic Int2FloatSortedMap headMap(int toKey)
Int2FloatSortedMapheadMap in interface Int2FloatSortedMaptoKey - where the headMap should endpublic Int2FloatSortedMap tailMap(int fromKey)
Int2FloatSortedMaptailMap in interface Int2FloatSortedMapfromKey - where the TailMap should start