|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface DoubleObjMap<V>
A Map specialization with double keys and Object values.
DoubleObjMapFactory| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Method Summary | |
|---|---|
V |
compute(double key,
DoubleObjFunction<? super V,? extends V> remappingFunction)
Attempts to compute a mapping for the specified key and its current mapped value (or null if there is no current mapping). |
V |
computeIfAbsent(double key,
DoubleFunction<? extends V> mappingFunction)
If the specified key is not already associated with a value (or is mapped to null), attempts
to compute its value using the given mapping function and enters it into this map
unless null. |
V |
computeIfPresent(double key,
DoubleObjFunction<? super V,? extends V> remappingFunction)
If the value for the specified key is present and non-null, attempts to compute a new mapping given the key and its current mapped value. |
boolean |
containsKey(double key)
Returns true if this map contains a mapping for the specified key. |
boolean |
containsKey(Object key)
Deprecated. Use specialization containsKey(double) instead |
DoubleObjCursor<V> |
cursor()
Returns a new cursor over the entries of this map. |
ObjSet<Map.Entry<Double,V>> |
entrySet()
|
void |
forEach(DoubleObjConsumer<? super V> action)
Performs the given action on each entry in this map until all entries
have been processed or the action throws an Exception. |
boolean |
forEachWhile(DoubleObjPredicate<? super V> predicate)
Checks the given predicate on each entry in this map until all entries
have been processed or the predicate returns false for some entry,
or throws an Exception. |
V |
get(double key)
Returns the value to which the specified key is mapped, or null if this map
contains no mapping for the key. |
V |
get(Object key)
Deprecated. Use specialization get(double) instead |
V |
getOrDefault(double key,
V defaultValue)
Returns the value to which the specified key is mapped, or defaultValue if this map
contains no mapping for the key. |
V |
getOrDefault(Object key,
V defaultValue)
Deprecated. Use specialization getOrDefault(double, Object) instead |
DoubleSet |
keySet()
|
V |
merge(double key,
V value,
BiFunction<? super V,? super V,? extends V> remappingFunction)
If the specified key is not already associated with a value (or is mapped to null), associates
it with the given value, otherwise, replaces the value with the results of the given
remapping function. |
V |
put(double key,
V value)
Associates the specified value with the specified key in this map (optional operation). |
V |
put(Double key,
V value)
Deprecated. Use specialization put(double, Object) instead |
V |
putIfAbsent(double key,
V value)
If the specified key is not already associated with a value (or is mapped to null), associates
it with the given value and returns null, else returns the current value. |
V |
putIfAbsent(Double key,
V value)
Deprecated. Use specialization putIfAbsent(double, Object) instead |
V |
remove(double key)
Removes the mapping for a key from this map if it is present (optional operation). |
boolean |
remove(double key,
Object value)
Removes the entry for the specified key only if it is currently mapped to the specified value. |
V |
remove(Object key)
Deprecated. Use specialization remove(double) instead |
boolean |
remove(Object key,
Object value)
Deprecated. Use specialization remove(double, Object) instead |
boolean |
removeIf(DoubleObjPredicate<? super V> filter)
Removes all of the entries of this collection that satisfy the given predicate. |
V |
replace(double key,
V value)
Replaces the entry for the specified key only if it is currently mapped to some value. |
V |
replace(Double key,
V value)
Deprecated. Use specialization replace(double, Object) instead |
boolean |
replace(double key,
V oldValue,
V newValue)
Replaces the entry for the specified key only if currently mapped to the specified value. |
boolean |
replace(Double key,
V oldValue,
V newValue)
Deprecated. Use specialization replace(double, Object, Object) instead |
void |
replaceAll(DoubleObjFunction<? super V,? extends V> function)
Replaces each entry's value with the result of invoking the given function on that entry, in the order entries are returned by an entry set iterator, until all entries have been processed or the function throws an exception. |
Equivalence<V> |
valueEquivalence()
Returns the equivalence strategy for values in this map. |
ObjCollection<V> |
values()
|
| Methods inherited from interface java.util.Map |
|---|
clear, containsValue, equals, hashCode, isEmpty, putAll, size |
| Methods inherited from interface net.openhft.collect.Container |
|---|
clear, ensureCapacity, isEmpty, shrink, size, sizeAsLong |
| Method Detail |
|---|
@Nullable Equivalence<V> valueEquivalence()
Map
interface which defined in terms of Object.equals(Object) equality of value objects,
for example, Map.containsValue(Object) and remove(double, Object),
are supposed to use this equivalence instead.
null if it is the default Object equalityDoubleObjMapFactory.withValueEquivalence(net.openhft.collect.Equivalence) @Deprecated boolean containsKey(Object key)
containsKey(double) instead
containsKey in interface Map<Double,V>boolean containsKey(double key)
true if this map contains a mapping for the specified key.
key - the double key whose presence in this map is to be tested
true if this map contains a mapping for the specified key@Nullable @Deprecated V get(Object key)
get(double) instead
get in interface Map<Double,V>@Nullable V get(double key)
null if this map
contains no mapping for the key.
If this map permits null values, then a return value of null does not
necessarily indicate that the map contains no mapping for the key; it's also possible
that the map explicitly maps the key to null. The containsKey
operation may be used to distinguish these two cases.
key - the key whose associated value is to be returned
null if this map
contains no mapping for the key
@Deprecated
V getOrDefault(Object key,
V defaultValue)
getOrDefault(double, Object) instead
defaultValue if this map contains no mapping for the key.
key - the key whose associated value is to be returneddefaultValue - the default mapping of the key
defaultValue if this map contains no mapping for the key
V getOrDefault(double key,
V defaultValue)
defaultValue if this map
contains no mapping for the key.
key - the key whose associated value is to be returned
defaultValue if this map contains no mapping for the key
void forEach(@Nonnull
DoubleObjConsumer<? super V> action)
action on each entry in this map until all entries
have been processed or the action throws an Exception.
Exceptions thrown by the action are relayed to the caller. The entries
will be processed in the same order as the entry set iterator unless that
order is unspecified in which case implementations may use an order which
differs from the entry set iterator.
action - The action to be performed for each entry
boolean forEachWhile(@Nonnull
DoubleObjPredicate<? super V> predicate)
predicate on each entry in this map until all entries
have been processed or the predicate returns false for some entry,
or throws an Exception. Exceptions thrown by the predicate are relayed to the caller.
The entries will be processed in the same order as the entry set iterator unless that order is unspecified in which case implementations may use an order which differs from the entry set iterator.
If the map is empty, this method returns true immediately.
predicate - the predicate to be checked for each entry
true if the predicate returned true for all entries of the map,
false if it returned false for the entry@Nonnull DoubleObjCursor<V> cursor()
@Nonnull DoubleSet keySet()
keySet in interface Map<Double,V>@Nonnull ObjCollection<V> values()
values in interface Map<Double,V>@Nonnull ObjSet<Map.Entry<Double,V>> entrySet()
entrySet in interface Map<Double,V>
@Deprecated
V put(Double key,
V value)
put(double, Object) instead
put in interface Map<Double,V>
V put(double key,
V value)
m is said to contain a mapping for a key k
if and only if m.containsKey(k) would return true.)
key - key with which the specified value is to be associatedvalue - value to be associated with the specified key
key, or null if there was
no mapping for key. (A null return can also indicate that the map
previously associated null with key.)
UnsupportedOperationException - if the put operation
is not supported by this map
ClassCastException - if the class of the specified value
prevents it from being stored in this map
NullPointerException - if the specified value is null,
and this map does not permit null values * @throws IllegalArgumentException if some property of a specified key
or value prevents it from being stored in this map
@Nullable
@Deprecated
V putIfAbsent(Double key,
V value)
putIfAbsent(double, Object) instead
null), associates
it with the given value and returns null, else returns the current value.
key - key with which the specified value is to be associatedvalue - value to be associated with the specified key
null if there was no mapping for the key.
(A null return can also indicate that the map
previously associated null with the key,
if the implementation supports null values.)
UnsupportedOperationException - if the put operation
is not supported by this map
ClassCastException - if the key or value is of an inappropriate type for this map
NullPointerException - if the specified key is null
IllegalArgumentException - if some property of the specified key
or value prevents it from being stored in this map
@Nullable
V putIfAbsent(double key,
V value)
null), associates
it with the given value and returns null, else returns the current value.
key - key with which the specified value is to be associatedvalue - value to be associated with the specified key
null
if there was no mapping for the key. (A null return
can also indicate that the map previously associated null
with the key, if the implementation supports such values.)
UnsupportedOperationException - if the put operation
is not supported by this map
ClassCastException - if the class of the specified value
prevents it from being stored in this map
NullPointerException - if the specified value is null,
and this map does not permit null values * @throws IllegalArgumentException if some property of a specified key
or value prevents it from being stored in this map
V compute(double key,
@Nonnull
DoubleObjFunction<? super V,? extends V> remappingFunction)
null if there is no current mapping).
If the function returns null, the mapping is removed (or
remains absent if initially absent).
If the function itself throws an (unchecked) exception, the exception is rethrown, and the current mapping is left unchanged.
key - key with which the specified value is to be associatedremappingFunction - the function to compute a value
ClassCastException - if the class of the
computed value
prevents it from being stored in this map (optional restriction)
UnsupportedOperationException - if the put operation
is not supported by this map
V computeIfAbsent(double key,
@Nonnull
DoubleFunction<? extends V> mappingFunction)
null), attempts
to compute its value using the given mapping function and enters it into this map
unless null. The most common usage is to construct
a new object serving as an initial mapped value or memoized result.
If the function returns null no mapping is recorded.
If the function itself throws an (unchecked) exception, the exception is rethrown, and no mapping is recorded.
key - key with which the specified value is to be associatedmappingFunction - the function to compute a value
ClassCastException - if the class of the
computed value
prevents it from being stored in this map (optional restriction)
UnsupportedOperationException - if the put operation
is not supported by this map
V computeIfPresent(double key,
@Nonnull
DoubleObjFunction<? super V,? extends V> remappingFunction)
If the function returns null, the mapping is removed.
If the function itself throws an (unchecked) exception, the exception is rethrown, and the current mapping is left unchanged.
key - key with which the specified value is to be associatedremappingFunction - the function to compute a value
ClassCastException - if the class of the
computed value
prevents it from being stored in this map (optional restriction)
UnsupportedOperationException - if the put operation
is not supported by this map
V merge(double key,
V value,
@Nonnull
BiFunction<? super V,? super V,? extends V> remappingFunction)
null), associates
it with the given value, otherwise, replaces the value with the results of the given
remapping function.
This method may be of use when combining multiple mapped values for a key.
If the function returns null, the mapping is removed.
If the remappingFunction itself throws an (unchecked) exception, the exception is rethrown, and the current mapping is left unchanged.
key - key with which the specified value is to be associatedvalue - the value to use if absentremappingFunction - the function to recompute a value if present
NullPointerException - if the remappingFunction is null
ClassCastException - if the class of the
computed value
prevents it from being stored in this map (optional restriction)
UnsupportedOperationException - if the put operation
is not supported by this map
@Nullable
@Deprecated
V replace(Double key,
V value)
replace(double, Object) instead
key - key with which the specified value is associatedvalue - value to be associated with the specified key
null if there was
no mapping for the key. (A null return can also indicate
that the map previously associated null with the key,
if the implementation supports null values.)
UnsupportedOperationException - if the put operation
is not supported by this map
NullPointerException - if the specified key is null
IllegalArgumentException - if some property of the specified value
prevents it from being stored in this map
@Nullable
V replace(double key,
V value)
key - key with which the specified value is associatedvalue - value to be associated with the specified key
null if there was no mapping for the key.
(A null return can also indicate that the map
previously associated null with the key,
if the implementation supports such values.)
ClassCastException - if the class of the specified value
prevents it from being stored in this map
NullPointerException - if the specified value is null,
and this map does not permit null values * @throws IllegalArgumentException if some property of a specified key
or value prevents it from being stored in this map
UnsupportedOperationException - if the put operation
is not supported by this map
@Deprecated
boolean replace(Double key,
V oldValue,
V newValue)
replace(double, Object, Object) instead
key - key with which the specified value is associatedoldValue - value expected to be associated with the specified keynewValue - value to be associated with the specified key
true if the value was replaced
UnsupportedOperationException - if the put operation
is not supported by this map
NullPointerException - if the specified key is null
IllegalArgumentException - if some property of the specified value
prevents it from being stored in this map
boolean replace(double key,
V oldValue,
V newValue)
key - key with which the specified value is associatedoldValue - value expected to be associated with the specified keynewValue - value to be associated with the specified key
true if the value was replaced
ClassCastException - if the class of the specified value
prevents it from being stored in this map
NullPointerException - if the specified value is null,
and this map does not permit null values * @throws IllegalArgumentException if some property of a specified key
or value prevents it from being stored in this map
UnsupportedOperationException - if the put operation
is not supported by this map
void replaceAll(@Nonnull
DoubleObjFunction<? super V,? extends V> function)
function - the function to apply to each entry
UnsupportedOperationException - if the set operation
is not supported by this map's entry set iterator
or the specified replacement value is null, and this map does not permit
null values (optional restriction)
ClassCastException - if the class of a replacement value
prevents it from being stored in this map
IllegalArgumentException - if some property of a replacement value
prevents it from being stored in this map (optional restriction)@Nullable @Deprecated V remove(Object key)
remove(double) instead
remove in interface Map<Double,V>@Nullable V remove(double key)
Returns the value to which this map previously associated the key, or null
if the map contained no mapping for the key.
A return value of null does not necessarily indicate that the map
contained no mapping for the key; it's also possible that the map
explicitly mapped the key to null.
The map will not contain a mapping for the specified key once the call returns.
key - key whose mapping is to be removed from the map
key, or null if there was
no mapping for key
ClassCastException - if the class of the specified value
prevents it from being stored in this map (optional restriction)
NullPointerException - if the specified value is null,
and this map does not permit null values (optional restriction)
UnsupportedOperationException - if the remove operation
is not supported by this map
@Deprecated
boolean remove(Object key,
Object value)
remove(double, Object) instead
key - key with which the specified value is associatedvalue - value expected to be associated with the specified key
true if the value was removed
NullPointerException - if the specified key is null
, or if the specified value is null,
and this map does not permit null values (optional restriction)
ClassCastException - if the class of the specified value
prevents it from being stored in this map (optional restriction)
UnsupportedOperationException - if the remove operation
is not supported by this map
boolean remove(double key,
Object value)
key - key with which the specified value is associatedvalue - value expected to be associated with the specified key
true if the value was removed
ClassCastException - if the class of the specified value
prevents it from being stored in this map (optional restriction)
NullPointerException - if the specified value is null,
and this map does not permit null values (optional restriction)
UnsupportedOperationException - if the remove operation
is not supported by this map
boolean removeIf(@Nonnull
DoubleObjPredicate<? super V> filter)
filter - a predicate which returns true for elements to be removed
true if any elements were removed
NullPointerException - if the specified filter is null
UnsupportedOperationException - if elements cannot be removed from this collection.
Implementations may throw this exception if a matching element cannot be removed
or if, in general, removal is not supported.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||