public class Float2IntArrayMap extends AbstractFloat2IntMap implements Float2IntOrderedMap
AbstractFloat2IntMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Float2IntOrderedMap.FastOrderedSetFloat2IntMap.BuilderCache, Float2IntMap.Entry, Float2IntMap.FastEntrySet, Float2IntMap.MapBuilder| Constructor and Description |
|---|
Float2IntArrayMap()
Default Constructor
|
Float2IntArrayMap(float[] keys,
int[] values)
Helper constructor that allow to create a map from unboxed values
|
Float2IntArrayMap(float[] keys,
int[] values,
int length)
Helper constructor that allow to create a map from unboxed values
|
Float2IntArrayMap(java.lang.Float[] keys,
java.lang.Integer[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Float2IntArrayMap(java.lang.Float[] keys,
java.lang.Integer[] values,
int length)
Helper constructor that allow to create a map from boxed values (it will unbox them) with a custom length
|
Float2IntArrayMap(Float2IntMap map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Float2IntArrayMap(int minCapacity)
Constructor that defines the minimum capacity
|
Float2IntArrayMap(java.util.Map<? extends java.lang.Float,? extends java.lang.Integer> 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 |
|---|---|
int |
addTo(float key,
int value)
A Helper method to add a primitives together.
|
void |
clear() |
int |
computeInt(float key,
FloatIntUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
int |
computeIntIfAbsent(float key,
Float2IntFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
int |
computeIntIfPresent(float key,
FloatIntUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(float key)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(int value)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsValue(java.lang.Object value) |
Float2IntArrayMap |
copy()
A Function that does a shallow clone of the Map itself.
|
float |
firstFloatKey()
A method to get the first Key of a Map.
|
int |
firstIntValue()
A method to get the first Value of a Map.
|
ObjectOrderedSet<Float2IntMap.Entry> |
float2IntEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
void |
forEach(FloatIntConsumer action)
Type Specific forEach method to reduce boxing/unboxing
|
int |
get(float key)
A Type Specific get method to reduce boxing/unboxing
|
int |
getAndMoveToFirst(float key)
A Specific get method that allows to move teh given key/value int the first index.
|
int |
getAndMoveToLast(float key)
A Specific get method that allows to move teh given key/value int the last index.
|
int |
getOrDefault(float key,
int defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
FloatOrderedSet |
keySet() |
float |
lastFloatKey()
A method to get the last Key of a Map.
|
int |
lastIntValue()
A method to get the last Value of a Map.
|
void |
mergeAllInt(Float2IntMap m,
IntIntUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
int |
mergeInt(float key,
int value,
IntIntUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
boolean |
moveToFirst(float key)
A specific move method to move a given key/value to the first index.
|
boolean |
moveToLast(float key)
A specific move method to move a given key/value to the last index.
|
float |
pollFirstFloatKey()
A method to get and remove the first Key of a Map.
|
float |
pollLastFloatKey()
A method to get and remove the last Key of a Map.
|
int |
put(float key,
int value)
Type Specific method to reduce boxing/unboxing of values
|
int |
putAndMoveToFirst(float key,
int value)
A customized put method that allows you to insert into the first index.
|
int |
putAndMoveToLast(float key,
int value)
A customized put method that allows you to insert into the last index.
|
int |
putIfAbsent(float key,
int value)
Type Specific method to reduce boxing/unboxing of values
|
int |
remove(float key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(float key,
int value)
Type Specific remove function to reduce boxing/unboxing
|
java.lang.Integer |
remove(java.lang.Object key) |
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
int |
removeOrDefault(float key,
int defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
int |
replace(float key,
int value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(float key,
int oldValue,
int newValue)
A Type Specific replace method to replace an existing value
|
int |
size() |
int |
subFrom(float key,
int value)
A Helper method to subtract from primitive from each other.
|
int |
supplyIntIfAbsent(float key,
IntSupplier valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
IntCollection |
values() |
addToAll, entrySet, equals, get, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, replaceInts, replaceInts, setDefaultReturnValuesynchronize, synchronize, unmodifiableaddToAll, applyAsInt, builder, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, put, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, replace, replace, replaceAll, replaceInts, replaceInts, setDefaultReturnValuepublic Float2IntArrayMap()
public Float2IntArrayMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Float2IntArrayMap(java.lang.Float[] keys,
java.lang.Integer[] 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 Float2IntArrayMap(java.lang.Float[] keys,
java.lang.Integer[] 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 Float2IntArrayMap(float[] keys,
int[] 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 Float2IntArrayMap(float[] keys,
int[] 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 Float2IntArrayMap(java.util.Map<? extends java.lang.Float,? extends java.lang.Integer> map)
map - the values that should be present in the mappublic Float2IntArrayMap(Float2IntMap map)
map - the values that should be present in the mappublic int put(float key,
int value)
Float2IntMapput in interface Float2IntMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public int putIfAbsent(float key,
int value)
Float2IntMapputIfAbsent in interface Float2IntMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public int addTo(float key,
int value)
Float2IntMapaddTo in interface Float2IntMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic int subFrom(float key,
int value)
Float2IntMapFloat2IntMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedsubFrom in interface Float2IntMapkey - that should be subtract fromvalue - that should be subtractpublic int putAndMoveToFirst(float key,
int value)
Float2IntOrderedMapputAndMoveToFirst in interface Float2IntOrderedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public int putAndMoveToLast(float key,
int value)
Float2IntOrderedMapputAndMoveToLast in interface Float2IntOrderedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(float key)
Float2IntOrderedMapmoveToFirst in interface Float2IntOrderedMapkey - that should be moved to the first indexpublic boolean moveToLast(float key)
Float2IntOrderedMapmoveToLast in interface Float2IntOrderedMapkey - that should be moved to the first lastpublic boolean containsKey(float key)
Float2IntMapcontainsKey in interface Float2IntMapcontainsKey in class AbstractFloat2IntMapkey - element that is searched forpublic boolean containsValue(int value)
Float2IntMapcontainsValue in interface Float2IntMapcontainsValue in class AbstractFloat2IntMapvalue - element that is searched forpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Float,java.lang.Integer>containsKey in interface Float2IntMapcontainsKey in class java.util.AbstractMap<java.lang.Float,java.lang.Integer>key - that is searched for.Map.containsKey(Object)public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.Float,java.lang.Integer>containsValue in interface Float2IntMapcontainsValue in class java.util.AbstractMap<java.lang.Float,java.lang.Integer>value - that is searched for.Map.containsValue(Object)public int get(float key)
Float2IntMapget in interface Float2IntMapkey - the key that is searched forpublic int getOrDefault(float key,
int defaultValue)
Float2IntMapgetOrDefault in interface Float2IntMapgetOrDefault in class AbstractFloat2IntMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic int getAndMoveToFirst(float key)
Float2IntOrderedMapgetAndMoveToFirst in interface Float2IntOrderedMapkey - that is searched forpublic int getAndMoveToLast(float key)
Float2IntOrderedMapgetAndMoveToLast in interface Float2IntOrderedMapkey - that is searched forpublic float firstFloatKey()
Float2IntOrderedMapfirstFloatKey in interface Float2IntOrderedMappublic float lastFloatKey()
Float2IntOrderedMaplastFloatKey in interface Float2IntOrderedMappublic int firstIntValue()
Float2IntOrderedMapfirstIntValue in interface Float2IntOrderedMappublic int lastIntValue()
Float2IntOrderedMaplastIntValue in interface Float2IntOrderedMappublic float pollFirstFloatKey()
Float2IntOrderedMappollFirstFloatKey in interface Float2IntOrderedMappublic float pollLastFloatKey()
Float2IntOrderedMappollLastFloatKey in interface Float2IntOrderedMappublic int remove(float key)
Float2IntMapremove in interface Float2IntMapkey - the element that should be removedpublic int removeOrDefault(float key,
int defaultValue)
Float2IntMapremoveOrDefault in interface Float2IntMapkey - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)public boolean remove(float key,
int value)
Float2IntMapremove in interface Float2IntMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public java.lang.Integer remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Float,java.lang.Integer>remove in interface Float2IntMapremove in class AbstractFloat2IntMapkey - 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.Float,java.lang.Integer>remove in interface Float2IntMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public void forEach(FloatIntConsumer action)
Float2IntMapforEach in interface Float2IntMapforEach in class AbstractFloat2IntMapaction - processor of the values that are iterator overpublic FloatOrderedSet keySet()
keySet in interface java.util.Map<java.lang.Float,java.lang.Integer>keySet in interface Float2IntMapkeySet in interface Float2IntOrderedMapkeySet in class AbstractFloat2IntMappublic IntCollection values()
values in interface java.util.Map<java.lang.Float,java.lang.Integer>values in interface Float2IntMapvalues in class AbstractFloat2IntMappublic ObjectOrderedSet<Float2IntMap.Entry> float2IntEntrySet()
Float2IntMapfloat2IntEntrySet in interface Float2IntMapfloat2IntEntrySet in interface Float2IntOrderedMappublic boolean replace(float key,
int oldValue,
int newValue)
Float2IntMapreplace in interface Float2IntMapreplace in class AbstractFloat2IntMapkey - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public int replace(float key,
int value)
Float2IntMapreplace in interface Float2IntMapreplace in class AbstractFloat2IntMapkey - the element that should be searched forvalue - the value to replace with.public int computeInt(float key,
FloatIntUnaryOperator mappingFunction)
Float2IntMapcomputeInt in interface Float2IntMapcomputeInt in class AbstractFloat2IntMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic int computeIntIfAbsent(float key,
Float2IntFunction mappingFunction)
Float2IntMapcomputeIntIfAbsent in interface Float2IntMapcomputeIntIfAbsent in class AbstractFloat2IntMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic int supplyIntIfAbsent(float key,
IntSupplier valueProvider)
Float2IntMapsupplyIntIfAbsent in interface Float2IntMapsupplyIntIfAbsent in class AbstractFloat2IntMapkey - the key that should be computedvalueProvider - the value if not presentpublic int computeIntIfPresent(float key,
FloatIntUnaryOperator mappingFunction)
Float2IntMapcomputeIntIfPresent in interface Float2IntMapcomputeIntIfPresent in class AbstractFloat2IntMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic int mergeInt(float key,
int value,
IntIntUnaryOperator mappingFunction)
Float2IntMapmergeInt in interface Float2IntMapmergeInt in class AbstractFloat2IntMapkey - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuepublic void mergeAllInt(Float2IntMap m, IntIntUnaryOperator mappingFunction)
Float2IntMapmergeAllInt in interface Float2IntMapmergeAllInt in class AbstractFloat2IntMapm - 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.Float,java.lang.Integer>size in class java.util.AbstractMap<java.lang.Float,java.lang.Integer>public void clear()
clear in interface java.util.Map<java.lang.Float,java.lang.Integer>clear in class java.util.AbstractMap<java.lang.Float,java.lang.Integer>public Float2IntArrayMap copy()
Float2IntMapcopy in interface Float2IntMapcopy in interface Float2IntOrderedMapcopy in class AbstractFloat2IntMap