/** * If <code>key</code> exists, <code>putValue</code> is inserted into the map, * otherwise any existing value is incremented by <code>additionValue</code>. * * @param key * The key of the value to adjust. * @param putValue * The value to put if <code>key</code> does not exist. * @param incrementValue * The value to add to the existing value if <code>key</code> exists. * @return Returns the current value associated with <code>key</code> (after * changes). */ @SuppressWarnings("cast") @Override public int putOrAdd(final char key, int putValue, final int incrementValue) { if (containsKey(key)) { putValue = get(key); putValue = (int) (((putValue) + (incrementValue))); } put(key, putValue); return putValue; }
final int otherValue = other.get(c.key);