Top Description Methods
org.eclipse.collections.api.map.primitive

public Interface MutableObjectDoubleMap<K>

extends ObjectDoubleMap<K>
Imports
org.eclipse.collections.api.block.function.primitive.DoubleFunction, .DoubleFunction0, .DoubleToDoubleFunction, .DoubleToObjectFunction, .ObjectDoubleToDoubleFunction, org.eclipse.collections.api.block.predicate.primitive.DoublePredicate, .ObjectDoublePredicate, org.eclipse.collections.api.block.procedure.primitive.DoubleProcedure, org.eclipse.collections.api.collection.MutableCollection, org.eclipse.collections.api.collection.primitive.MutableDoubleCollection, org.eclipse.collections.api.iterator.MutableDoubleIterator, org.eclipse.collections.api.tuple.primitive.ObjectDoublePair

This file was automatically generated from template file mutableObjectPrimitiveMap.stg.
Since
3.0.

Method Summary

Modifier and TypeMethod and Description
public double
addToValue(K key, double toBeAdded)

public MutableObjectDoubleMap<K>
public MutableObjectDoubleMap<K>
public void
clear()

Removes all entries from this map.

public <V> MutableCollection<V>
collect(DoubleToObjectFunction<? extends V> function)

Redeclares org.eclipse.collections.api.DoubleIterable.collect.

Returns a new collection with the results of applying the specified function on each element of the source collection.

public MutableDoubleIterator
doubleIterator()

Redeclares org.eclipse.collections.api.DoubleIterable.doubleIterator.

Returns a primitive iterator that can be used to iterate over the DoubleIterable in an imperative style.

public MutableDoubleObjectMap<K>
flipUniqueValues()

Redeclares org.eclipse.collections.api.map.primitive.ObjectDoubleMap.flipUniqueValues.

Return the DoubleObjectMap that is obtained by flipping the direction of this map and making the associations from value to key.

public default double

Returns:

the value associated with key, if one exists, or defaultValue if not
getAndPut
(K
the key
key
,
double
the value to associate with key if no such mapping exists
putValue
,
double
the value to return if no mapping associated with key exists
defaultValue
)

Retrieves the value associated with the key if one exists; if it does not, associates a putValue with the key.

public double

Returns:

the value associated with key, if one exists, or value if not
getIfAbsentPut
(K
the key
key
,
double
the value to associate with key if no such mapping exists
value
)

Retrieves the value associated with the key if one exists; if it does not, associates a value with the key.

public double

Returns:

the value associated with the key, if one exists, or the result of invoking function if not
getIfAbsentPut
(K
the key
key
,
DoubleFunction0
the supplier that provides the value if no mapping exists for key
function
)

Retrieves the value associated with the key if one exists; if it does not, invokes the supplier and associates the result with the key.

public <
the type of the value function's parameter
P
>
double

Returns:

the value associated with the key, if one exists, or the result of invoking function with parameter if not
getIfAbsentPutWith
(K
the key
key
,
DoubleFunction<? super P>
the function that provides the value if no mapping exists. The specified parameter will be passed as the argument to the function.
function
,
P
the parameter to provide to function if no value exists for key
parameter
)

Retrieves the value associated with the key if one exists; if it does not, invokes the value function with the parameter and associates the result with the key.

public double

Returns:

the value associated with the key, if one exists, or the result of invoking function with key if not
getIfAbsentPutWithKey
(K
the key
key
,
DoubleFunction<? super K>
the function that provides the value if no mapping exists. The key will be passed as the argument to the function.
function
)

Retrieves the value associated with the key if one exists; if it does not, associates the result of invoking the value function with the key.

public void
put(K
the key
key
,
double
the value to associate with value
value
)

Associates a value with the specified key.

public void
putAll(ObjectDoubleMap<? extends K>
the map to copy into this map
map
)

Puts all of the key/value mappings from the specified map into this map.

public default void
putPair(ObjectDoublePair<K> keyValuePair)

This method allows MutableObjectDoubleMap the ability to add an element in the form of ObjectDoublePair<K>.

public MutableObjectDoubleMap<K>
reject(ObjectDoublePredicate<? super K> predicate)

Redeclares org.eclipse.collections.api.map.primitive.ObjectDoubleMap.reject.

Return a copy of this map containing only the key/value pairs that do not match the predicate.

public MutableDoubleCollection
reject(DoublePredicate predicate)

Redeclares org.eclipse.collections.api.DoubleIterable.reject.

Returns a new DoubleIterable with all of the elements in the DoubleIterable that return false for the specified predicate.

public void
remove(Object
the key to remove
key
)

Removes the mapping associated with the key, if one exists, from the map.

public void
removeKey(K
the key to remove
key
)

Removes the mapping associated with the key, if one exists, from the map.

public double

Returns:

the value previously associated with the key, if one existed, or value if not
removeKeyIfAbsent
(K
the key to remove
key
,
double
the default value to return if no mapping for the key exists
value
)

Removes the mapping associated with the key, if one exists, from the map, returning the previously associated value with the key.

public MutableObjectDoubleMap<K>
select(ObjectDoublePredicate<? super K> predicate)

Redeclares org.eclipse.collections.api.map.primitive.ObjectDoubleMap.select.

Return a copy of this map containing only the key/value pairs that match the predicate.

public MutableDoubleCollection
select(DoublePredicate predicate)

Redeclares org.eclipse.collections.api.DoubleIterable.select.

Returns a new DoubleIterable with all of the elements in the DoubleIterable that return true for the specified predicate.

public default MutableObjectDoubleMap<K>
public double

Returns:

the new value associated with the key, either as a result of applying function to the value already associated with the key or as a result of applying it to initialValueIfAbsent and associating the result with key
updateValue
(K
the key
key
,
double
the initial value to supply to the function if no mapping exists for the key
initialValueIfAbsent
,
DoubleToDoubleFunction
the function that returns the updated value based on the current value or the initial value, if no value exists
function
)

Updates or sets the value associated with the key by applying the function to the existing value, if one exists, or to the specified initial value if one does not.

public void
updateValues(ObjectDoubleToDoubleFunction<? super K>
that takes a key and its value and that returns a new value for this key
function
)

Updates the values in-place.

public default MutableObjectDoubleMap<K>
public MutableObjectDoubleMap<K>

Returns:

this map
withKeyValue
(K
the key
key
,
double
the value to associate with value
value
)

Associates a value with the specified key.

public MutableObjectDoubleMap<K>

Returns:

this map
withoutAllKeys
(Iterable<? extends K>
the keys to remove
keys
)

Removes the mappings associated with all the keys, if they exist, from this map.

public MutableObjectDoubleMap<K>

Returns:

this map
withoutKey
(K
the key to remove
key
)

Removes the mapping associated with the key, if one exists, from this map.

Inherited from org.eclipse.collections.api.map.primitive.ObjectDoubleMap:
allSatisfyKeyValuecontainsKeycontainsValueforEachKeyforEachKeyValueforEachValuegetgetIfAbsentgetOrThrowinjectIntoKeyValuekeySetkeysViewkeyValuesViewtoImmutabletoStringvalues

Method Detail

addToValueback to summary
public double addToValue(K key, double toBeAdded)
asSynchronizedback to summary
public MutableObjectDoubleMap<K> asSynchronized()
asUnmodifiableback to summary
public MutableObjectDoubleMap<K> asUnmodifiable()
clearback to summary
public void clear()

Removes all entries from this map.

collectback to summary
public <V> MutableCollection<V> collect(DoubleToObjectFunction<? extends V> function)

Redeclares org.eclipse.collections.api.DoubleIterable.collect.

Doc from org.eclipse.collections.api.DoubleIterable.collect.

Returns a new collection with the results of applying the specified function on each element of the source collection. This method is also commonly called transform or map.

Annotations
@Override
doubleIteratorback to summary
public MutableDoubleIterator doubleIterator()

Redeclares org.eclipse.collections.api.DoubleIterable.doubleIterator.

Doc from org.eclipse.collections.api.DoubleIterable.doubleIterator.

Returns a primitive iterator that can be used to iterate over the DoubleIterable in an imperative style.

Annotations
@Override
flipUniqueValuesback to summary
public MutableDoubleObjectMap<K> flipUniqueValues()

Redeclares org.eclipse.collections.api.map.primitive.ObjectDoubleMap.flipUniqueValues.

Doc from org.eclipse.collections.api.map.primitive.ObjectDoubleMap.flipUniqueValues.

Return the DoubleObjectMap that is obtained by flipping the direction of this map and making the associations from value to key.

Annotations
@Override
getAndPutback to summary
public default double getAndPut(K key, double putValue, double defaultValue)

Retrieves the value associated with the key if one exists; if it does not, associates a putValue with the key.

Parameters
key:K

the key

putValue:double

the value to associate with key if no such mapping exists

defaultValue:double

the value to return if no mapping associated with key exists

Returns:double

the value associated with key, if one exists, or defaultValue if not

Since
11.1.
getIfAbsentPutback to summary
public double getIfAbsentPut(K key, double value)

Retrieves the value associated with the key if one exists; if it does not, associates a value with the key. a new value with they key

Parameters
key:K

the key

value:double

the value to associate with key if no such mapping exists

Returns:double

the value associated with key, if one exists, or value if not

getIfAbsentPutback to summary
public double getIfAbsentPut(K key, DoubleFunction0 function)

Retrieves the value associated with the key if one exists; if it does not, invokes the supplier and associates the result with the key.

Parameters
key:K

the key

function:DoubleFunction0

the supplier that provides the value if no mapping exists for key

Returns:double

the value associated with the key, if one exists, or the result of invoking function if not

getIfAbsentPutWithback to summary
public <P> double getIfAbsentPutWith(K key, DoubleFunction<? super P> function, P parameter)

Retrieves the value associated with the key if one exists; if it does not, invokes the value function with the parameter and associates the result with the key.

Parameters
<P>
the type of the value function's parameter
key:K

the key

function:DoubleFunction<? super P>

the function that provides the value if no mapping exists. The specified parameter will be passed as the argument to the function.

parameter:P

the parameter to provide to function if no value exists for key

Returns:double

the value associated with the key, if one exists, or the result of invoking function with parameter if not

getIfAbsentPutWithKeyback to summary
public double getIfAbsentPutWithKey(K key, DoubleFunction<? super K> function)

Retrieves the value associated with the key if one exists; if it does not, associates the result of invoking the value function with the key.

Parameters
key:K

the key

function:DoubleFunction<? super K>

the function that provides the value if no mapping exists. The key will be passed as the argument to the function.

Returns:double

the value associated with the key, if one exists, or the result of invoking function with key if not

putback to summary
public void put(K key, double value)

Associates a value with the specified key. If a value is already associated with the key in this map, it will be replaced with value.

Parameters
key:K

the key

value:double

the value to associate with value

putAllback to summary
public void putAll(ObjectDoubleMap<? extends K> map)

Puts all of the key/value mappings from the specified map into this map. If this map already has a value associated with one of the keys in the map, it will be replaced with the value in map.

Parameters
map:ObjectDoubleMap<? extends K>

the map to copy into this map

putPairback to summary
public default void putPair(ObjectDoublePair<K> keyValuePair)

This method allows MutableObjectDoubleMap the ability to add an element in the form of ObjectDoublePair<K>.

Since
9.1.0
See Also
put(Object, double)
rejectback to summary
public MutableObjectDoubleMap<K> reject(ObjectDoublePredicate<? super K> predicate)

Redeclares org.eclipse.collections.api.map.primitive.ObjectDoubleMap.reject.

Doc from org.eclipse.collections.api.map.primitive.ObjectDoubleMap.reject.

Return a copy of this map containing only the key/value pairs that do not match the predicate.

Annotations
@Override
rejectback to summary
public MutableDoubleCollection reject(DoublePredicate predicate)

Redeclares org.eclipse.collections.api.DoubleIterable.reject.

Doc from org.eclipse.collections.api.DoubleIterable.reject.

Returns a new DoubleIterable with all of the elements in the DoubleIterable that return false for the specified predicate.

Annotations
@Override
removeback to summary
public void remove(Object key)

Removes the mapping associated with the key, if one exists, from the map.

Parameters
key:Object

the key to remove

See Also
removeKey(K)
removeKeyback to summary
public void removeKey(K key)

Removes the mapping associated with the key, if one exists, from the map.

Parameters
key:K

the key to remove

See Also
remove(Object)
removeKeyIfAbsentback to summary
public double removeKeyIfAbsent(K key, double value)

Removes the mapping associated with the key, if one exists, from the map, returning the previously associated value with the key. If no mapping existed for the key, the specified default value is returned.

Parameters
key:K

the key to remove

value:double

the default value to return if no mapping for the key exists

Returns:double

the value previously associated with the key, if one existed, or value if not

selectback to summary
public MutableObjectDoubleMap<K> select(ObjectDoublePredicate<? super K> predicate)

Redeclares org.eclipse.collections.api.map.primitive.ObjectDoubleMap.select.

Doc from org.eclipse.collections.api.map.primitive.ObjectDoubleMap.select.

Return a copy of this map containing only the key/value pairs that match the predicate.

Annotations
@Override
selectback to summary
public MutableDoubleCollection select(DoublePredicate predicate)

Redeclares org.eclipse.collections.api.DoubleIterable.select.

Doc from org.eclipse.collections.api.DoubleIterable.select.

Returns a new DoubleIterable with all of the elements in the DoubleIterable that return true for the specified predicate.

Annotations
@Override
tapback to summary
public default MutableObjectDoubleMap<K> tap(DoubleProcedure procedure)

Overrides default org.eclipse.collections.api.map.primitive.ObjectDoubleMap.tap.

Annotations
@Override
Since
9.0.
updateValueback to summary
public double updateValue(K key, double initialValueIfAbsent, DoubleToDoubleFunction function)

Updates or sets the value associated with the key by applying the function to the existing value, if one exists, or to the specified initial value if one does not.

Parameters
key:K

the key

initialValueIfAbsent:double

the initial value to supply to the function if no mapping exists for the key

function:DoubleToDoubleFunction

the function that returns the updated value based on the current value or the initial value, if no value exists

Returns:double

the new value associated with the key, either as a result of applying function to the value already associated with the key or as a result of applying it to initialValueIfAbsent and associating the result with key

updateValuesback to summary
public void updateValues(ObjectDoubleToDoubleFunction<? super K> function)

Updates the values in-place.

Parameters
function:ObjectDoubleToDoubleFunction<? super K>

that takes a key and its value and that returns a new value for this key

Since
10.0
withAllKeyValuesback to summary
public default MutableObjectDoubleMap<K> withAllKeyValues(Iterable<ObjectDoublePair<K>> keyValuePairs)
withKeyValueback to summary
public MutableObjectDoubleMap<K> withKeyValue(K key, double value)

Associates a value with the specified key. If a value is already associated with the key in this map, it will be replaced with value.

Parameters
key:K

the key

value:double

the value to associate with value

Returns:MutableObjectDoubleMap<K>

this map

See Also
put(K, double)
withoutAllKeysback to summary
public MutableObjectDoubleMap<K> withoutAllKeys(Iterable<? extends K> keys)

Removes the mappings associated with all the keys, if they exist, from this map.

Parameters
keys:Iterable<? extends K>

the keys to remove

Returns:MutableObjectDoubleMap<K>

this map

See Also
remove(Object)
withoutKeyback to summary
public MutableObjectDoubleMap<K> withoutKey(K key)

Removes the mapping associated with the key, if one exists, from this map.

Parameters
key:K

the key to remove

Returns:MutableObjectDoubleMap<K>

this map

See Also
remove(Object)