@Override public boolean apply(double key, double value) { put(key, value); return true; } }
@Override public boolean apply(double key, double value) { put(key, function.apply(value)); return true; } }
/** * Check the map for a key. If present, add an increment to the value. If absent, * store a specified value. * @param key the key. * @param newValue the value to store if the key is not currently in the map. * @param incrValue the value to be added to the current value in the map. **/ public double adjustOrPutValue(double key, double newValue, double incrValue) { boolean present = containsKey(key); if (present) { newValue = (double)(get(key) + incrValue); put(key, newValue); } else { put(key, newValue); } return newValue; } }
@Override public boolean apply(double key, double value) { put(key, value); return true; } }
@Override public boolean apply(double key, double value) { put(key, value); return true; } }
@Override public boolean apply(double key, double value) { put(key, function.apply(value)); return true; } }
@Override public boolean apply(double key, double value) { put(key, function.apply(value)); return true; } }
/** * Check the map for a key. If present, add an increment to the value. If absent, * store a specified value. * @param key the key. * @param newValue the value to store if the key is not currently in the map. * @param incrValue the value to be added to the current value in the map. **/ public double adjustOrPutValue(double key, double newValue, double incrValue) { boolean present = containsKey(key); if (present) { newValue = (double)(get(key) + incrValue); put(key, newValue); } else { put(key, newValue); } return newValue; } }
/** * Check the map for a key. If present, add an increment to the value. If absent, * store a specified value. * @param key the key. * @param newValue the value to store if the key is not currently in the map. * @param incrValue the value to be added to the current value in the map. **/ public double adjustOrPutValue(double key, double newValue, double incrValue) { boolean present = containsKey(key); if (present) { newValue = (double)(get(key) + incrValue); put(key, newValue); } else { put(key, newValue); } return newValue; } }