public class Long2DoubleArrayMap extends AbstractLong2DoubleMap implements Long2DoubleOrderedMap
AbstractLong2DoubleMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Long2DoubleOrderedMap.FastOrderedSetLong2DoubleMap.BuilderCache, Long2DoubleMap.Entry, Long2DoubleMap.FastEntrySet, Long2DoubleMap.MapBuilder| Constructor and Description |
|---|
Long2DoubleArrayMap()
Default Constructor
|
Long2DoubleArrayMap(int minCapacity)
Constructor that defines the minimum capacity
|
Long2DoubleArrayMap(long[] keys,
double[] values)
Helper constructor that allow to create a map from unboxed values
|
Long2DoubleArrayMap(java.lang.Long[] keys,
java.lang.Double[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Long2DoubleArrayMap(long[] keys,
double[] values,
int length)
Helper constructor that allow to create a map from unboxed values
|
Long2DoubleArrayMap(java.lang.Long[] 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
|
Long2DoubleArrayMap(Long2DoubleMap map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Long2DoubleArrayMap(java.util.Map<? extends java.lang.Long,? 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(long key,
double value)
A Helper method to add a primitives together.
|
void |
clear() |
double |
computeDouble(long key,
LongDoubleUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
double |
computeDoubleIfAbsent(long key,
Long2DoubleFunction mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
double |
computeDoubleIfPresent(long key,
LongDoubleUnaryOperator mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(long 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) |
Long2DoubleArrayMap |
copy()
A Function that does a shallow clone of the Map itself.
|
double |
firstDoubleValue()
A method to get the first Value of a Map.
|
long |
firstLongKey()
A method to get the first Key of a Map.
|
void |
forEach(LongDoubleConsumer action)
Type Specific forEach method to reduce boxing/unboxing
|
double |
get(long key)
A Type Specific get method to reduce boxing/unboxing
|
double |
getAndMoveToFirst(long key)
A Specific get method that allows to move teh given key/value int the first index.
|
double |
getAndMoveToLast(long key)
A Specific get method that allows to move teh given key/value int the last index.
|
double |
getOrDefault(long key,
double defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
LongOrderedSet |
keySet() |
double |
lastDoubleValue()
A method to get the last Value of a Map.
|
long |
lastLongKey()
A method to get the last Key of a Map.
|
ObjectOrderedSet<Long2DoubleMap.Entry> |
long2DoubleEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
void |
mergeAllDouble(Long2DoubleMap m,
DoubleDoubleUnaryOperator mappingFunction)
A Bulk method for merging Maps.
|
double |
mergeDouble(long key,
double value,
DoubleDoubleUnaryOperator mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
boolean |
moveToFirst(long key)
A specific move method to move a given key/value to the first index.
|
boolean |
moveToLast(long key)
A specific move method to move a given key/value to the last index.
|
long |
pollFirstLongKey()
A method to get and remove the first Key of a Map.
|
long |
pollLastLongKey()
A method to get and remove the last Key of a Map.
|
double |
put(long key,
double value)
Type Specific method to reduce boxing/unboxing of values
|
double |
putAndMoveToFirst(long key,
double value)
A customized put method that allows you to insert into the first index.
|
double |
putAndMoveToLast(long key,
double value)
A customized put method that allows you to insert into the last index.
|
double |
putIfAbsent(long key,
double value)
Type Specific method to reduce boxing/unboxing of values
|
double |
remove(long key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(long 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(long key,
double defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
double |
replace(long key,
double value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(long key,
double oldValue,
double newValue)
A Type Specific replace method to replace an existing value
|
int |
size() |
double |
subFrom(long key,
double value)
A Helper method to subtract from primitive from each other.
|
double |
supplyDoubleIfAbsent(long 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 Long2DoubleArrayMap()
public Long2DoubleArrayMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Long2DoubleArrayMap(java.lang.Long[] 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 Long2DoubleArrayMap(java.lang.Long[] 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 Long2DoubleArrayMap(long[] 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 Long2DoubleArrayMap(long[] 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 Long2DoubleArrayMap(java.util.Map<? extends java.lang.Long,? extends java.lang.Double> map)
map - the values that should be present in the mappublic Long2DoubleArrayMap(Long2DoubleMap map)
map - the values that should be present in the mappublic double put(long key,
double value)
Long2DoubleMapput in interface Long2DoubleMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public double putIfAbsent(long key,
double value)
Long2DoubleMapputIfAbsent in interface Long2DoubleMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public double addTo(long key,
double value)
Long2DoubleMapaddTo in interface Long2DoubleMapkey - the key that should be inserted,value - the value that should be inserted / addedpublic double subFrom(long key,
double value)
Long2DoubleMapLong2DoubleMap.getDefaultReturnValue()
If the fence is reached the element will be automaticall removedsubFrom in interface Long2DoubleMapkey - that should be subtract fromvalue - that should be subtractpublic double putAndMoveToFirst(long key,
double value)
Long2DoubleOrderedMapputAndMoveToFirst in interface Long2DoubleOrderedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public double putAndMoveToLast(long key,
double value)
Long2DoubleOrderedMapputAndMoveToLast in interface Long2DoubleOrderedMapkey - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(long key)
Long2DoubleOrderedMapmoveToFirst in interface Long2DoubleOrderedMapkey - that should be moved to the first indexpublic boolean moveToLast(long key)
Long2DoubleOrderedMapmoveToLast in interface Long2DoubleOrderedMapkey - that should be moved to the first lastpublic boolean containsKey(long key)
Long2DoubleMapcontainsKey in interface Long2DoubleMapcontainsKey in class AbstractLong2DoubleMapkey - element that is searched forpublic boolean containsValue(double value)
Long2DoubleMapcontainsValue in interface Long2DoubleMapcontainsValue in class AbstractLong2DoubleMapvalue - element that is searched forpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Long,java.lang.Double>containsKey in interface Long2DoubleMapcontainsKey in class java.util.AbstractMap<java.lang.Long,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.Long,java.lang.Double>containsValue in interface Long2DoubleMapcontainsValue in class java.util.AbstractMap<java.lang.Long,java.lang.Double>value - that is searched for.Map.containsValue(Object)public double get(long key)
Long2DoubleMapget in interface Long2DoubleMapkey - the key that is searched forpublic double getOrDefault(long key,
double defaultValue)
Long2DoubleMapgetOrDefault in interface Long2DoubleMapgetOrDefault in class AbstractLong2DoubleMapkey - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic double getAndMoveToFirst(long key)
Long2DoubleOrderedMapgetAndMoveToFirst in interface Long2DoubleOrderedMapkey - that is searched forpublic double getAndMoveToLast(long key)
Long2DoubleOrderedMapgetAndMoveToLast in interface Long2DoubleOrderedMapkey - that is searched forpublic long firstLongKey()
Long2DoubleOrderedMapfirstLongKey in interface Long2DoubleOrderedMappublic long lastLongKey()
Long2DoubleOrderedMaplastLongKey in interface Long2DoubleOrderedMappublic double firstDoubleValue()
Long2DoubleOrderedMapfirstDoubleValue in interface Long2DoubleOrderedMappublic double lastDoubleValue()
Long2DoubleOrderedMaplastDoubleValue in interface Long2DoubleOrderedMappublic long pollFirstLongKey()
Long2DoubleOrderedMappollFirstLongKey in interface Long2DoubleOrderedMappublic long pollLastLongKey()
Long2DoubleOrderedMappollLastLongKey in interface Long2DoubleOrderedMappublic double remove(long key)
Long2DoubleMapremove in interface Long2DoubleMapkey - the element that should be removedpublic double removeOrDefault(long key,
double defaultValue)
Long2DoubleMapremoveOrDefault in interface Long2DoubleMapkey - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)public boolean remove(long key,
double value)
Long2DoubleMapremove in interface Long2DoubleMapkey - 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.Long,java.lang.Double>remove in interface Long2DoubleMapremove in class AbstractLong2DoubleMapkey - 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.Long,java.lang.Double>remove in interface Long2DoubleMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public void forEach(LongDoubleConsumer action)
Long2DoubleMapforEach in interface Long2DoubleMapforEach in class AbstractLong2DoubleMapaction - processor of the values that are iterator overpublic LongOrderedSet keySet()
keySet in interface java.util.Map<java.lang.Long,java.lang.Double>keySet in interface Long2DoubleMapkeySet in interface Long2DoubleOrderedMapkeySet in class AbstractLong2DoubleMappublic DoubleCollection values()
values in interface java.util.Map<java.lang.Long,java.lang.Double>values in interface Long2DoubleMapvalues in class AbstractLong2DoubleMappublic ObjectOrderedSet<Long2DoubleMap.Entry> long2DoubleEntrySet()
Long2DoubleMaplong2DoubleEntrySet in interface Long2DoubleMaplong2DoubleEntrySet in interface Long2DoubleOrderedMappublic boolean replace(long key,
double oldValue,
double newValue)
Long2DoubleMapreplace in interface Long2DoubleMapreplace in class AbstractLong2DoubleMapkey - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public double replace(long key,
double value)
Long2DoubleMapreplace in interface Long2DoubleMapreplace in class AbstractLong2DoubleMapkey - the element that should be searched forvalue - the value to replace with.public double computeDouble(long key,
LongDoubleUnaryOperator mappingFunction)
Long2DoubleMapcomputeDouble in interface Long2DoubleMapcomputeDouble in class AbstractLong2DoubleMapkey - the key that should be computedmappingFunction - the operator that should generate the valuepublic double computeDoubleIfAbsent(long key,
Long2DoubleFunction mappingFunction)
Long2DoubleMapcomputeDoubleIfAbsent in interface Long2DoubleMapcomputeDoubleIfAbsent in class AbstractLong2DoubleMapkey - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic double supplyDoubleIfAbsent(long key,
DoubleSupplier valueProvider)
Long2DoubleMapsupplyDoubleIfAbsent in interface Long2DoubleMapsupplyDoubleIfAbsent in class AbstractLong2DoubleMapkey - the key that should be computedvalueProvider - the value if not presentpublic double computeDoubleIfPresent(long key,
LongDoubleUnaryOperator mappingFunction)
Long2DoubleMapcomputeDoubleIfPresent in interface Long2DoubleMapcomputeDoubleIfPresent in class AbstractLong2DoubleMapkey - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic double mergeDouble(long key,
double value,
DoubleDoubleUnaryOperator mappingFunction)
Long2DoubleMapmergeDouble in interface Long2DoubleMapmergeDouble in class AbstractLong2DoubleMapkey - 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(Long2DoubleMap m, DoubleDoubleUnaryOperator mappingFunction)
Long2DoubleMapmergeAllDouble in interface Long2DoubleMapmergeAllDouble in class AbstractLong2DoubleMapm - 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.Long,java.lang.Double>size in class java.util.AbstractMap<java.lang.Long,java.lang.Double>public void clear()
clear in interface java.util.Map<java.lang.Long,java.lang.Double>clear in class java.util.AbstractMap<java.lang.Long,java.lang.Double>public Long2DoubleArrayMap copy()
Long2DoubleMapcopy in interface Long2DoubleMapcopy in interface Long2DoubleOrderedMapcopy in class AbstractLong2DoubleMap