KeyType
- The type of the key in the map.public interface ScalarMap<KeyType> extends NumericMap<KeyType>
Modifier and Type | Interface and Description |
---|---|
static interface |
ScalarMap.Entry<KeyType>
An entry in a scalar map.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<KeyType,? extends java.lang.Number> |
asMap()
Gets a
java.util.Map that contains the same data as in this
scalar map. |
double |
decrement(KeyType key)
Decrements the value associated with a given key by 1.0.
|
double |
decrement(KeyType key,
double value)
Decrements the value associated with the given key by the given amount.
|
void |
decrementAll(java.lang.Iterable<? extends KeyType> keys)
Decrements the values associated all of the given keys by 1.0.
|
void |
decrementAll(ScalarMap<? extends KeyType> other)
Decrements all the keys in this map by the values in the other one.
|
java.util.Set<? extends ScalarMap.Entry<KeyType>> |
entrySet()
Gets the set of entries in this scalar map.
|
double |
get(KeyType key)
Gets the value associated with a given key.
|
double |
getMaxValue()
The maximum value associated with any key in the map.
|
double |
getMinValue()
The minimum value associated with any key in the map.
|
double |
increment(KeyType key)
Increments the value associated with the given key by 1.0.
|
double |
increment(KeyType key,
double value)
Increments the value associated with the given key by the given amount.
|
void |
incrementAll(java.lang.Iterable<? extends KeyType> keys)
Increments the values associated all of the given keys by 1.0.
|
void |
incrementAll(ScalarMap<? extends KeyType> other)
Increments all the keys in this map by the values in the other one.
|
void |
set(KeyType key,
double value)
Sets the value associated with a given key.
|
void |
setAll(java.lang.Iterable<? extends KeyType> keys,
double value)
Sets all the given keys to the given value.
|
void |
setAll(ScalarMap<? extends KeyType> other)
Sets all the given keys to the given value.
|
clear, containsKey, getMaxValueKey, getMaxValueKeys, getMinValueKey, getMinValueKeys, isEmpty, keySet, size
java.util.Map<KeyType,? extends java.lang.Number> asMap()
java.util.Map
that contains the same data as in this
scalar map.Map
version of this data structure.double get(KeyType key)
key
- A key.void set(KeyType key, double value)
key
- A key.value
- The value to associate with the key.void setAll(java.lang.Iterable<? extends KeyType> keys, double value)
keys
- A list of keys.value
- The value to associate with all the given keys.void setAll(ScalarMap<? extends KeyType> other)
other
- The other map.double increment(KeyType key)
key
- A key.double increment(KeyType key, double value)
key
- A key.value
- The amount to increment the value associated with the given key by.void incrementAll(java.lang.Iterable<? extends KeyType> keys)
keys
- A list of keys.void incrementAll(ScalarMap<? extends KeyType> other)
other
- The other map.double decrement(KeyType key)
key
- A key.double decrement(KeyType key, double value)
key
- A key.value
- The amount to decrement the value associated with the given key by.void decrementAll(java.lang.Iterable<? extends KeyType> keys)
keys
- A list of keys.void decrementAll(ScalarMap<? extends KeyType> other)
other
- The other map.double getMaxValue()
double getMinValue()
java.util.Set<? extends ScalarMap.Entry<KeyType>> entrySet()