@Override public int put(final int k, final int v) { Entry e = add(k); final int oldValue = e.value; e.value = v; return oldValue; } /**
/** * Adds an increment to value currently associated with a key. * * <p> * Note that this method respects the {@linkplain #defaultReturnValue() default * return value} semantics: when called with a key that does not currently * appears in the map, the key will be associated with the default return value * plus the given increment. * * @param k * the key. * @param incr * the increment. * @return the old value, or the {@linkplain #defaultReturnValue() default * return value} if no value was present for the given key. */ public int addTo(final int k, final int incr) { Entry e = add(k); final int oldValue = e.value; e.value += incr; return oldValue; } @Override