public class Int2DoubleArrayMap extends AbstractInt2DoubleMap implements Int2DoubleOrderedMap
AbstractInt2DoubleMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Int2DoubleOrderedMap.FastOrderedSetInt2DoubleMap.BuilderCache, Int2DoubleMap.Entry, Int2DoubleMap.FastEntrySet, Int2DoubleMap.MapBuilder| Constructor and Description |
|---|
Int2DoubleArrayMap()
Default Constructor
|
Int2DoubleArrayMap(int minCapacity)
Constructor that defines the minimum capacity
|
Int2DoubleArrayMap(int[] keys,
double[] values)
Helper constructor that allow to create a map from unboxed values
|
Int2DoubleArrayMap(int[] keys,
double[] values,
int length)
Helper constructor that allow to create a map from unboxed values
|
Int2DoubleArrayMap(Int2DoubleMap map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Int2DoubleArrayMap(java.lang.Integer[] keys,
java.lang.Double[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Int2DoubleArrayMap(java.lang.Integer[] keys,
java.lang.Double[] values,
int length)
Helper constructor that allow to create a map from boxed values (it will unbox them) with a custom length
|
Int2DoubleArrayMap(java.util.Map<? extends java.lang.Integer,? extends java.lang.Double> 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 |
|---|---|
double |
addTo(int key,
double value)
A Helper method to add a primitives together.
|
void |
clear() |
double |
computeDouble(int key,
IntDoubleUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
double |
computeDoubleIfAbsent(int key,
Int2DoubleFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
double |
computeDoubleIfPresent(int key,
IntDoubleUnaryOperator 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(double value)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsValue(java.lang.Object value) |
Int2DoubleArrayMap |
copy()
A Function that does a shallow clone of the Map itself.
|
double |
firstDoubleValue()
A method to get the first Value of a Map.
|
int |
firstIntKey()
A method to get the first Key of a Map.
|
void |
forEach(IntDoubleConsumer action)
Type Specific forEach method to reduce boxing/unboxing
|
double |
get(int key)
A Type Specific get method to reduce boxing/unboxing
|
double |
getAndMoveToFirst(int key)
A Specific get method that allows to move teh given key/value int the first index.
|
double |
getAndMoveToLast(int key)
A Specific get method that allows to move teh given key/value int the last index.
|
double |
getOrDefault(int key,
double defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
ObjectOrderedSet<Int2DoubleMap.Entry> |
int2DoubleEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
IntOrderedSet |
keySet() |
double |
lastDoubleValue()
A method to get the last Value of a Map.
|
int |
lastIntKey()
A method to get the last Key of a Map.
|
void |
mergeAllDouble(Int2DoubleMap m,
DoubleDoubleUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
double |
mergeDouble(int key,
double value,
DoubleDoubleUnaryOperator 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.
|
double |
put(int key,
double value)
Type Specific method to reduce boxing/unboxing of values
|
double |
putAndMoveToFirst(int key,
double value)
A customized put method that allows you to insert into the first index.
|
double |
putAndMoveToLast(int key,
double value)
A customized put method that allows you to insert into the last index.
|
double |
putIfAbsent(int key,
double value)
Type Specific method to reduce boxing/unboxing of values
|
double |
remove(int key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(int key,
double value)
Type Specific remove function to reduce boxing/unboxing
|
java.lang.Double |
remove(java.lang.Object key) |
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
double |
removeOrDefault(int key,
double defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
double |
replace(int key,
double value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(int key,
double oldValue,
double newValue)
A Type Specific replace method to replace an existing value
|
int |
size() |
double |
subFrom(int key,
double value)
A Helper method to subtract from primitive from each other.
|
double |
supplyDoubleIfAbsent(int key,
DoubleSupplier valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
DoubleCollection |
values() |
addToAll, entrySet, equals, get, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, replaceDoubles, replaceDoubles, setDefaultReturnValuesynchronize, synchronize, unmodifiableaddToAll, applyAsDouble, builder, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, put, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, replace, replace, replaceAll, replaceDoubles, replaceDoubles, setDefaultReturnValuepublic Int2DoubleArrayMap()
public Int2DoubleArrayMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Int2DoubleArrayMap(java.lang.Integer[] keys,
java.lang.Double[] 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 Int2DoubleArrayMap(java.lang.Integer[] keys,
java.lang.Double[] 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 Int2DoubleArrayMap(int[] keys,
double[] 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 Int2DoubleArrayMap(int[] keys,
double[] 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 Int2DoubleArrayMap(java.util.Map<? extends java.lang.Integer,? extends java.lang.Double> map)
map - the values that should be present in the mappublic Int2DoubleArrayMap(Int2DoubleMap map)
map - the values that should be present in the mappublic double put(int key,
double value)
Int2DoubleMapput in interface Int2DoubleMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public double putIfAbsent(int key,
double value)
Int2DoubleMapputIfAbsent in interface Int2DoubleMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public double addTo(int key,
double value)
Int2DoubleMapaddTo in interface Int2DoubleMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic double subFrom(int key,
double value)
Int2DoubleMapInt2DoubleMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedsubFrom in interface Int2DoubleMapkey - that should be subtract fromvalue - that should be subtractpublic double putAndMoveToFirst(int key,
double value)
Int2DoubleOrderedMapputAndMoveToFirst in interface Int2DoubleOrderedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public double putAndMoveToLast(int key,
double value)
Int2DoubleOrderedMapputAndMoveToLast in interface Int2DoubleOrderedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(int key)
Int2DoubleOrderedMapmoveToFirst in interface Int2DoubleOrderedMapkey - that should be moved to the first indexpublic boolean moveToLast(int key)
Int2DoubleOrderedMapmoveToLast in interface Int2DoubleOrderedMapkey - that should be moved to the first lastpublic boolean containsKey(int key)
Int2DoubleMapcontainsKey in interface Int2DoubleMapcontainsKey in class AbstractInt2DoubleMapkey - element that is searched forpublic boolean containsValue(double value)
Int2DoubleMapcontainsValue in interface Int2DoubleMapcontainsValue in class AbstractInt2DoubleMapvalue - element that is searched forpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Integer,java.lang.Double>containsKey in interface Int2DoubleMapcontainsKey in class java.util.AbstractMap<java.lang.Integer,java.lang.Double>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.Double>containsValue in interface Int2DoubleMapcontainsValue in class java.util.AbstractMap<java.lang.Integer,java.lang.Double>value - that is searched for.Map.containsValue(Object)public double get(int key)
Int2DoubleMapget in interface Int2DoubleMapkey - the key that is searched forpublic double getOrDefault(int key,
double defaultValue)
Int2DoubleMapgetOrDefault in interface Int2DoubleMapgetOrDefault in class AbstractInt2DoubleMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic double getAndMoveToFirst(int key)
Int2DoubleOrderedMapgetAndMoveToFirst in interface Int2DoubleOrderedMapkey - that is searched forpublic double getAndMoveToLast(int key)
Int2DoubleOrderedMapgetAndMoveToLast in interface Int2DoubleOrderedMapkey - that is searched forpublic int firstIntKey()
Int2DoubleOrderedMapfirstIntKey in interface Int2DoubleOrderedMappublic int lastIntKey()
Int2DoubleOrderedMaplastIntKey in interface Int2DoubleOrderedMappublic double firstDoubleValue()
Int2DoubleOrderedMapfirstDoubleValue in interface Int2DoubleOrderedMappublic double lastDoubleValue()
Int2DoubleOrderedMaplastDoubleValue in interface Int2DoubleOrderedMappublic int pollFirstIntKey()
Int2DoubleOrderedMappollFirstIntKey in interface Int2DoubleOrderedMappublic int pollLastIntKey()
Int2DoubleOrderedMappollLastIntKey in interface Int2DoubleOrderedMappublic double remove(int key)
Int2DoubleMapremove in interface Int2DoubleMapkey - the element that should be removedpublic double removeOrDefault(int key,
double defaultValue)
Int2DoubleMapremoveOrDefault in interface Int2DoubleMapkey - 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,
double value)
Int2DoubleMapremove in interface Int2DoubleMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public java.lang.Double remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Integer,java.lang.Double>remove in interface Int2DoubleMapremove in class AbstractInt2DoubleMapkey - 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.Double>remove in interface Int2DoubleMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public void forEach(IntDoubleConsumer action)
Int2DoubleMapforEach in interface Int2DoubleMapforEach in class AbstractInt2DoubleMapaction - processor of the values that are iterator overpublic IntOrderedSet keySet()
keySet in interface java.util.Map<java.lang.Integer,java.lang.Double>keySet in interface Int2DoubleMapkeySet in interface Int2DoubleOrderedMapkeySet in class AbstractInt2DoubleMappublic DoubleCollection values()
values in interface java.util.Map<java.lang.Integer,java.lang.Double>values in interface Int2DoubleMapvalues in class AbstractInt2DoubleMappublic ObjectOrderedSet<Int2DoubleMap.Entry> int2DoubleEntrySet()
Int2DoubleMapint2DoubleEntrySet in interface Int2DoubleMapint2DoubleEntrySet in interface Int2DoubleOrderedMappublic boolean replace(int key,
double oldValue,
double newValue)
Int2DoubleMapreplace in interface Int2DoubleMapreplace in class AbstractInt2DoubleMapkey - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public double replace(int key,
double value)
Int2DoubleMapreplace in interface Int2DoubleMapreplace in class AbstractInt2DoubleMapkey - the element that should be searched forvalue - the value to replace with.public double computeDouble(int key,
IntDoubleUnaryOperator mappingFunction)
Int2DoubleMapcomputeDouble in interface Int2DoubleMapcomputeDouble in class AbstractInt2DoubleMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic double computeDoubleIfAbsent(int key,
Int2DoubleFunction mappingFunction)
Int2DoubleMapcomputeDoubleIfAbsent in interface Int2DoubleMapcomputeDoubleIfAbsent in class AbstractInt2DoubleMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic double supplyDoubleIfAbsent(int key,
DoubleSupplier valueProvider)
Int2DoubleMapsupplyDoubleIfAbsent in interface Int2DoubleMapsupplyDoubleIfAbsent in class AbstractInt2DoubleMapkey - the key that should be computedvalueProvider - the value if not presentpublic double computeDoubleIfPresent(int key,
IntDoubleUnaryOperator mappingFunction)
Int2DoubleMapcomputeDoubleIfPresent in interface Int2DoubleMapcomputeDoubleIfPresent in class AbstractInt2DoubleMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic double mergeDouble(int key,
double value,
DoubleDoubleUnaryOperator mappingFunction)
Int2DoubleMapmergeDouble in interface Int2DoubleMapmergeDouble in class AbstractInt2DoubleMapkey - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuepublic void mergeAllDouble(Int2DoubleMap m, DoubleDoubleUnaryOperator mappingFunction)
Int2DoubleMapmergeAllDouble in interface Int2DoubleMapmergeAllDouble in class AbstractInt2DoubleMapm - 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.Double>size in class java.util.AbstractMap<java.lang.Integer,java.lang.Double>public void clear()
clear in interface java.util.Map<java.lang.Integer,java.lang.Double>clear in class java.util.AbstractMap<java.lang.Integer,java.lang.Double>public Int2DoubleArrayMap copy()
Int2DoubleMapcopy in interface Int2DoubleMapcopy in interface Int2DoubleOrderedMapcopy in class AbstractInt2DoubleMap