public class IntDoubleMapArray extends AbstractMap<Integer,Double>
Double.NaN
may not be inserted and negative numbers may not be used
for the key. This is meant as a convenience class, and should be used
sparingly.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
IntDoubleMapArray() |
IntDoubleMapArray(int max_index) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(int key) |
boolean |
containsKey(Object key) |
Set<Map.Entry<Integer,Double>> |
entrySet() |
double |
get(int key)
Returns the value to which the specified key is mapped, or
Double.NaN if this map contains no mapping for the key. |
Double |
get(Object key) |
double |
increment(int key,
double delta) |
double |
put(int key,
double value) |
Double |
put(Integer key,
Double value) |
double |
remove(int key) |
Double |
remove(Object key) |
clone, containsValue, equals, hashCode, isEmpty, keySet, putAll, size, toString, values
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public IntDoubleMapArray()
public IntDoubleMapArray(int max_index)
public double put(int key, double value)
public double increment(int key, double delta)
key
- the key whose associated value is to be incremented. All
non-present keys behave as having an implicit value of zero, in which
case the delta value is directly inserted into the map.delta
- the amount by which to increment the key's stored value.public double get(int key)
Double.NaN
if this map contains no mapping for the key.key
- the key whose associated value is to be returnedDouble.NaN
if this map contains no mapping for the keypublic double remove(int key)
key
- Double.NaN
if the
key was not present in the mappublic void clear()
public boolean containsKey(Object key)
containsKey
in interface Map<Integer,Double>
containsKey
in class AbstractMap<Integer,Double>
public boolean containsKey(int key)
Copyright © 2017. All rights reserved.