public class Int2DoubleArrayMap extends AbstractInt2DoubleMap implements Int2DoubleSortedMap
AbstractInt2DoubleMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Int2DoubleSortedMap.FastSortedSetInt2DoubleMap.Entry, Int2DoubleMap.FastEntrySet| 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() |
IntComparator |
comparator() |
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) |
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 |
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 |
getDouble(int key)
A Type Specific get method to reduce boxing/unboxing
|
double |
getOrDefault(int key,
double defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
Int2DoubleSortedMap |
headMap(int toKey)
A Type Specific HeadMap method to reduce boxing/unboxing
|
ObjectSortedSet<Int2DoubleMap.Entry> |
int2DoubleEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
IntSet |
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 |
remInt(int key)
Type Specific remove function to reduce boxing/unboxing
|
double |
remIntOrDefault(int key,
double defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
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 |
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() |
Int2DoubleSortedMap |
subMap(int fromKey,
int toKey)
A Type Specific SubMap method to reduce boxing/unboxing
|
Int2DoubleSortedMap |
tailMap(int fromKey)
A Type Specific TailMap method to reduce boxing/unboxing
|
DoubleCollection |
values() |
addToAll, entrySet, equals, get, getDefaultReturnValue, getOrDefault, hashCode, putAll, putAll, putAll, putAllIfAbsent, replaceDoubles, replaceDoubles, setDefaultReturnValuefirstKey, headMap, lastKey, subMap, tailMapaddToAll, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, replace, replace, replaceAll, replaceDoubles, replaceDoubles, setDefaultReturnValueapplyAsDoublepublic 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 putAndMoveToFirst(int key,
double value)
Int2DoubleSortedMapputAndMoveToFirst in interface Int2DoubleSortedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public double putAndMoveToLast(int key,
double value)
Int2DoubleSortedMapputAndMoveToLast in interface Int2DoubleSortedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(int key)
Int2DoubleSortedMapmoveToFirst in interface Int2DoubleSortedMapkey - that should be moved to the first indexpublic boolean moveToLast(int key)
Int2DoubleSortedMapmoveToLast in interface Int2DoubleSortedMapkey - 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 getDouble(int key)
Int2DoubleMapgetDouble in interface Int2DoubleFunctiongetDouble 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)
Int2DoubleSortedMapgetAndMoveToFirst in interface Int2DoubleSortedMapkey - that is searched forpublic double getAndMoveToLast(int key)
Int2DoubleSortedMapgetAndMoveToLast in interface Int2DoubleSortedMapkey - that is searched forpublic int firstIntKey()
Int2DoubleSortedMapfirstIntKey in interface Int2DoubleSortedMappublic int lastIntKey()
Int2DoubleSortedMaplastIntKey in interface Int2DoubleSortedMappublic double firstDoubleValue()
Int2DoubleSortedMapfirstDoubleValue in interface Int2DoubleSortedMappublic double lastDoubleValue()
Int2DoubleSortedMaplastDoubleValue in interface Int2DoubleSortedMappublic int pollFirstIntKey()
Int2DoubleSortedMappollFirstIntKey in interface Int2DoubleSortedMappublic int pollLastIntKey()
Int2DoubleSortedMappollLastIntKey in interface Int2DoubleSortedMappublic double remInt(int key)
Int2DoubleMapremInt in interface Int2DoubleMapkey - the element that should be removedpublic double remIntOrDefault(int key,
double defaultValue)
Int2DoubleMapremIntOrDefault 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 java.util.AbstractMap<java.lang.Integer,java.lang.Double>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.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 IntSet keySet()
keySet in interface java.util.Map<java.lang.Integer,java.lang.Double>keySet in interface java.util.SortedMap<java.lang.Integer,java.lang.Double>keySet in interface Int2DoubleMapkeySet in interface Int2DoubleSortedMapkeySet in class AbstractInt2DoubleMappublic DoubleCollection values()
values in interface java.util.Map<java.lang.Integer,java.lang.Double>values in interface java.util.SortedMap<java.lang.Integer,java.lang.Double>values in interface Int2DoubleMapvalues in interface Int2DoubleSortedMapvalues in class AbstractInt2DoubleMappublic ObjectSortedSet<Int2DoubleMap.Entry> int2DoubleEntrySet()
Int2DoubleMapint2DoubleEntrySet in interface Int2DoubleMappublic 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 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 IntComparator comparator()
comparator in interface java.util.SortedMap<java.lang.Integer,java.lang.Double>comparator in interface Int2DoubleSortedMappublic Int2DoubleSortedMap subMap(int fromKey, int toKey)
Int2DoubleSortedMapsubMap in interface Int2DoubleSortedMapfromKey - where the submap should starttoKey - where the subMap should endpublic Int2DoubleSortedMap headMap(int toKey)
Int2DoubleSortedMapheadMap in interface Int2DoubleSortedMaptoKey - where the headMap should endpublic Int2DoubleSortedMap tailMap(int fromKey)
Int2DoubleSortedMaptailMap in interface Int2DoubleSortedMapfromKey - where the TailMap should start