V - the keyType of elements maintained by this Collectionpublic class Double2ObjectArrayMap<V> extends AbstractDouble2ObjectMap<V> implements Double2ObjectOrderedMap<V>
AbstractDouble2ObjectMap.BasicEntry<V>java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>Double2ObjectOrderedMap.FastOrderedSet<V>Double2ObjectMap.BuilderCache<V>, Double2ObjectMap.Entry<V>, Double2ObjectMap.FastEntrySet<V>, Double2ObjectMap.MapBuilder| Constructor and Description |
|---|
Double2ObjectArrayMap()
Default Constructor
|
Double2ObjectArrayMap(double[] keys,
V[] values)
Helper constructor that allow to create a map from unboxed values
|
Double2ObjectArrayMap(java.lang.Double[] keys,
V[] values)
Helper constructor that allow to create a map from boxed values (it will unbox them)
|
Double2ObjectArrayMap(double[] keys,
V[] values,
int length)
Helper constructor that allow to create a map from unboxed values
|
Double2ObjectArrayMap(java.lang.Double[] keys,
V[] values,
int length)
Helper constructor that allow to create a map from boxed values (it will unbox them) with a custom length
|
Double2ObjectArrayMap(Double2ObjectMap<V> map)
A Type Specific Helper function that allows to create a new Map with exactly the same values as the provided map.
|
Double2ObjectArrayMap(int minCapacity)
Constructor that defines the minimum capacity
|
Double2ObjectArrayMap(java.util.Map<? extends java.lang.Double,? extends V> 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 |
|---|---|
void |
clear() |
V |
compute(double key,
DoubleObjectUnaryOperator<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfAbsent(double key,
DoubleFunction<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
V |
computeIfPresent(double key,
DoubleObjectUnaryOperator<V> mappingFunction)
A Type Specific compute method to reduce boxing/unboxing
|
boolean |
containsKey(double key)
Type Specific method to reduce boxing/unboxing of values
|
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
Double2ObjectArrayMap<V> |
copy()
A Function that does a shallow clone of the Map itself.
|
ObjectOrderedSet<Double2ObjectMap.Entry<V>> |
double2ObjectEntrySet()
Type Sensitive EntrySet to reduce boxing/unboxing and optionally Temp Object Allocation.
|
double |
firstDoubleKey()
A method to get the first Key of a Map.
|
V |
firstValue()
A method to get the first Value of a Map.
|
void |
forEach(DoubleObjectConsumer<V> action)
Type Specific forEach method to reduce boxing/unboxing
|
V |
get(double key)
A Type Specific get method to reduce boxing/unboxing
|
V |
getAndMoveToFirst(double key)
A Specific get method that allows to move teh given key/value int the first index.
|
V |
getAndMoveToLast(double key)
A Specific get method that allows to move teh given key/value int the last index.
|
V |
getOrDefault(double key,
V defaultValue)
A Type Specific getOrDefault method to reduce boxing/unboxing
|
DoubleOrderedSet |
keySet() |
double |
lastDoubleKey()
A method to get the last Key of a Map.
|
V |
lastValue()
A method to get the last Value of a Map.
|
V |
merge(double key,
V value,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Type Specific merge method to reduce boxing/unboxing
|
void |
mergeAll(Double2ObjectMap<V> m,
ObjectObjectUnaryOperator<V,V> mappingFunction)
A Bulk method for merging Maps.
|
boolean |
moveToFirst(double key)
A specific move method to move a given key/value to the first index.
|
boolean |
moveToLast(double key)
A specific move method to move a given key/value to the last index.
|
double |
pollFirstDoubleKey()
A method to get and remove the first Key of a Map.
|
double |
pollLastDoubleKey()
A method to get and remove the last Key of a Map.
|
V |
put(double key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
putAndMoveToFirst(double key,
V value)
A customized put method that allows you to insert into the first index.
|
V |
putAndMoveToLast(double key,
V value)
A customized put method that allows you to insert into the last index.
|
V |
putIfAbsent(double key,
V value)
Type Specific method to reduce boxing/unboxing of values
|
V |
remove(double key)
Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(double key,
V value)
Type Specific remove function to reduce boxing/unboxing
|
V |
remove(java.lang.Object key) |
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
V |
removeOrDefault(double key,
V defaultValue)
Type-Specific Remove function with a default return value if wanted.
|
V |
replace(double key,
V value)
A Type Specific replace method to reduce boxing/unboxing replace an existing value
|
boolean |
replace(double key,
V oldValue,
V newValue)
A Type Specific replace method to replace an existing value
|
int |
size() |
V |
supplyIfAbsent(double key,
ObjectSupplier<V> valueProvider)
A Supplier based computeIfAbsent function to fill the most used usecase of this function
|
ObjectCollection<V> |
values() |
entrySet, equals, get, getDefaultReturnValue, getOrDefault, hashCode, put, putAll, putAll, putAll, putAll, putAllIfAbsent, replaceObjects, replaceObjects, setDefaultReturnValuesynchronize, synchronize, unmodifiableapply, builder, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, get, getDefaultReturnValue, getOrDefault, merge, put, put, put, putAll, putAll, putAll, putAll, putAll, putAllIfAbsent, putIfAbsent, replace, replace, replaceAll, replaceObjects, replaceObjects, setDefaultReturnValuepublic Double2ObjectArrayMap()
public Double2ObjectArrayMap(int minCapacity)
minCapacity - the minimum capacity the HashMap is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic Double2ObjectArrayMap(java.lang.Double[] keys,
V[] 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 Double2ObjectArrayMap(java.lang.Double[] keys,
V[] 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 Double2ObjectArrayMap(double[] keys,
V[] 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 Double2ObjectArrayMap(double[] keys,
V[] 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 Double2ObjectArrayMap(java.util.Map<? extends java.lang.Double,? extends V> map)
map - the values that should be present in the mappublic Double2ObjectArrayMap(Double2ObjectMap<V> map)
map - the values that should be present in the mappublic V put(double key, V value)
Double2ObjectMapput in interface Double2ObjectMap<V>key - the key that should be inserted,value - the value that should be insertedMap.put(Object, Object)public V putIfAbsent(double key, V value)
Double2ObjectMapputIfAbsent in interface Double2ObjectMap<V>key - the key that should be inserted,value - the value that should be insertedMap.putIfAbsent(Object, Object)public V putAndMoveToFirst(double key, V value)
Double2ObjectOrderedMapputAndMoveToFirst in interface Double2ObjectOrderedMap<V>key - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public V putAndMoveToLast(double key, V value)
Double2ObjectOrderedMapputAndMoveToLast in interface Double2ObjectOrderedMap<V>key - the key that should be insertedvalue - the value that should be insertedMap.put(Object, Object)public boolean moveToFirst(double key)
Double2ObjectOrderedMapmoveToFirst in interface Double2ObjectOrderedMap<V>key - that should be moved to the first indexpublic boolean moveToLast(double key)
Double2ObjectOrderedMapmoveToLast in interface Double2ObjectOrderedMap<V>key - that should be moved to the first lastpublic boolean containsKey(double key)
Double2ObjectMapcontainsKey in interface Double2ObjectMap<V>containsKey in class AbstractDouble2ObjectMap<V>key - element that is searched forpublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.Double,V>containsKey in interface Double2ObjectMap<V>containsKey in class java.util.AbstractMap<java.lang.Double,V>key - that is searched for.Map.containsKey(Object)public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.Double,V>containsValue in class AbstractDouble2ObjectMap<V>public V get(double key)
Double2ObjectMapget in interface Double2ObjectMap<V>key - the key that is searched forpublic V getOrDefault(double key, V defaultValue)
Double2ObjectMapgetOrDefault in interface Double2ObjectMap<V>getOrDefault in class AbstractDouble2ObjectMap<V>key - the key that is searched fordefaultValue - the value that should be returned if the key is not presentpublic V getAndMoveToFirst(double key)
Double2ObjectOrderedMapgetAndMoveToFirst in interface Double2ObjectOrderedMap<V>key - that is searched forpublic V getAndMoveToLast(double key)
Double2ObjectOrderedMapgetAndMoveToLast in interface Double2ObjectOrderedMap<V>key - that is searched forpublic double firstDoubleKey()
Double2ObjectOrderedMapfirstDoubleKey in interface Double2ObjectOrderedMap<V>public double lastDoubleKey()
Double2ObjectOrderedMaplastDoubleKey in interface Double2ObjectOrderedMap<V>public V firstValue()
Double2ObjectOrderedMapfirstValue in interface Double2ObjectOrderedMap<V>public V lastValue()
Double2ObjectOrderedMaplastValue in interface Double2ObjectOrderedMap<V>public double pollFirstDoubleKey()
Double2ObjectOrderedMappollFirstDoubleKey in interface Double2ObjectOrderedMap<V>public double pollLastDoubleKey()
Double2ObjectOrderedMappollLastDoubleKey in interface Double2ObjectOrderedMap<V>public V remove(double key)
Double2ObjectMapremove in interface Double2ObjectMap<V>key - the element that should be removedpublic V removeOrDefault(double key, V defaultValue)
Double2ObjectMapremoveOrDefault in interface Double2ObjectMap<V>key - the element that should be removeddefaultValue - the value that should be returned if the entry doesn't existMap.remove(Object, Object)public boolean remove(double key,
V value)
Double2ObjectMapremove in interface Double2ObjectMap<V>key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public V remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Double,V>remove in interface Double2ObjectMap<V>remove in class AbstractDouble2ObjectMap<V>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.Double,V>remove in interface Double2ObjectMap<V>key - the element that should be removedvalue - the expected value that should be foundMap.remove(Object, Object)public void forEach(DoubleObjectConsumer<V> action)
Double2ObjectMapforEach in interface Double2ObjectMap<V>forEach in class AbstractDouble2ObjectMap<V>action - processor of the values that are iterator overpublic DoubleOrderedSet keySet()
keySet in interface java.util.Map<java.lang.Double,V>keySet in interface Double2ObjectMap<V>keySet in interface Double2ObjectOrderedMap<V>keySet in class AbstractDouble2ObjectMap<V>public ObjectCollection<V> values()
values in interface java.util.Map<java.lang.Double,V>values in interface Double2ObjectMap<V>values in class AbstractDouble2ObjectMap<V>public ObjectOrderedSet<Double2ObjectMap.Entry<V>> double2ObjectEntrySet()
Double2ObjectMapdouble2ObjectEntrySet in interface Double2ObjectMap<V>double2ObjectEntrySet in interface Double2ObjectOrderedMap<V>public boolean replace(double key,
V oldValue,
V newValue)
Double2ObjectMapreplace in interface Double2ObjectMap<V>replace in class AbstractDouble2ObjectMap<V>key - the element that should be searched foroldValue - the expected value to be replacednewValue - the value to replace the oldValue with.public V replace(double key, V value)
Double2ObjectMapreplace in interface Double2ObjectMap<V>replace in class AbstractDouble2ObjectMap<V>key - the element that should be searched forvalue - the value to replace with.public V compute(double key, DoubleObjectUnaryOperator<V> mappingFunction)
Double2ObjectMapcompute in interface Double2ObjectMap<V>compute in class AbstractDouble2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the valuepublic V computeIfAbsent(double key, DoubleFunction<V> mappingFunction)
Double2ObjectMapcomputeIfAbsent in interface Double2ObjectMap<V>computeIfAbsent in class AbstractDouble2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the value if not presentpublic V supplyIfAbsent(double key, ObjectSupplier<V> valueProvider)
Double2ObjectMapsupplyIfAbsent in interface Double2ObjectMap<V>supplyIfAbsent in class AbstractDouble2ObjectMap<V>key - the key that should be computedvalueProvider - the value if not presentpublic V computeIfPresent(double key, DoubleObjectUnaryOperator<V> mappingFunction)
Double2ObjectMapcomputeIfPresent in interface Double2ObjectMap<V>computeIfPresent in class AbstractDouble2ObjectMap<V>key - the key that should be computedmappingFunction - the operator that should generate the value if presentpublic V merge(double key, V value, ObjectObjectUnaryOperator<V,V> mappingFunction)
Double2ObjectMapmerge in interface Double2ObjectMap<V>merge in class AbstractDouble2ObjectMap<V>key - the key that should be be searched forvalue - the value that should be merged withmappingFunction - the operator that should generate the new Valuepublic void mergeAll(Double2ObjectMap<V> m, ObjectObjectUnaryOperator<V,V> mappingFunction)
Double2ObjectMapmergeAll in interface Double2ObjectMap<V>mergeAll in class AbstractDouble2ObjectMap<V>m - the entries that should be bulk addedmappingFunction - the operator that should generate the new Valuepublic int size()
public void clear()
public Double2ObjectArrayMap<V> copy()
Double2ObjectMapcopy in interface Double2ObjectMap<V>copy in interface Double2ObjectOrderedMap<V>copy in class AbstractDouble2ObjectMap<V>