public static class Int2DoubleMaps.SingletonMap extends AbstractInt2DoubleMap
AbstractInt2DoubleMap.BasicEntryjava.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Int2DoubleMap.BuilderCache, Int2DoubleMap.Entry, Int2DoubleMap.FastEntrySet, Int2DoubleMap.MapBuilder| Modifier and Type | Method and Description |
|---|---|
double |
addTo(int key,
double value)
A Helper method to add a primitives together.
|
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
|
Int2DoubleMaps.SingletonMap |
copy()
A Function that does a shallow clone of the Map itself.
|
double |
get(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
|
ObjectSet<Int2DoubleMap.Entry> |
int2DoubleEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
IntSet |
keySet() |
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
|
double |
put(int key,
double value)
Type Specific method to reduce boxing/unboxing of values
|
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
|
double |
removeOrDefault(int key,
double defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
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, containsKey, containsValue, entrySet, equals, forEach, get, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, remove, replace, replace, replaceDoubles, replaceDoubles, setDefaultReturnValueclear, containsKey, containsValue, isEmpty, size, toStringapplyAsDouble, builder, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, forEach, merge, put, put, putAll, putAll, putIfAbsent, remove, replace, replace, replaceAll, synchronize, synchronize, unmodifiablepublic double put(int key,
double value)
Int2DoubleMapkey - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public double putIfAbsent(int key,
double value)
Int2DoubleMapkey - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public double addTo(int key,
double value)
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 removedkey - that should be subtract fromvalue - that should be subtractpublic double remove(int key)
Int2DoubleMapkey - the element that should be removedpublic double removeOrDefault(int key,
double defaultValue)
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)
Int2DoubleMapkey - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public double get(int key)
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 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 supplyDoubleIfAbsent(int key,
DoubleSupplier valueProvider)
Int2DoubleMapsupplyDoubleIfAbsent in interface Int2DoubleMapsupplyDoubleIfAbsent in class AbstractInt2DoubleMapkey - the key that should be computedvalueProvider - the value if not 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 Int2DoubleMaps.SingletonMap copy()
Int2DoubleMapcopy in interface Int2DoubleMapcopy in class AbstractInt2DoubleMappublic IntSet keySet()
keySet in interface java.util.Map<java.lang.Integer,java.lang.Double>keySet in interface Int2DoubleMapkeySet in class AbstractInt2DoubleMappublic DoubleCollection values()
values in interface java.util.Map<java.lang.Integer,java.lang.Double>values in interface Int2DoubleMapvalues in class AbstractInt2DoubleMappublic ObjectSet<Int2DoubleMap.Entry> int2DoubleEntrySet()
Int2DoubleMap