E - an Enum classpublic class AmountMap<E extends java.lang.Enum<?>>
extends java.util.HashMap<E,java.lang.Double>
implements java.lang.Cloneable
| Constructor and Description |
|---|
AmountMap() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(E key,
double amount)
This method add a particular amount in a key.
|
AmountMap<E> |
clone() |
AmountMap<E> |
multiplyByAScalar(double scalar)
This method multiplies all the values in the current instance by a scalar.
|
void |
putAll(java.util.Map<? extends E,? extends java.lang.Double> map) |
static void |
scaleMap(java.util.Map oMap,
double scalar)
This method scales the AmountMap instances contained in more complex Map instances.
|
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuespublic void putAll(java.util.Map<? extends E,? extends java.lang.Double> map)
public void add(E key, double amount)
key - amount - public AmountMap<E> multiplyByAScalar(double scalar)
scalar - the multiplicative factorpublic AmountMap<E> clone()
clone in class java.util.HashMap<E extends java.lang.Enum<?>,java.lang.Double>public static void scaleMap(java.util.Map oMap,
double scalar)
oMap - scalar - the multiplier factor