equal
deleted
inserted
replaced
461 |
461 |
462 /** |
462 /** |
463 * {@inheritDoc} |
463 * {@inheritDoc} |
464 * |
464 * |
465 * @implSpec |
465 * @implSpec |
466 * The default implementation is equivalent to performing the |
466 * The default implementation is equivalent to performing the following |
467 * following steps for this {@code map}, then returning the |
467 * steps for this {@code map}, then returning the current value or |
468 * current value or {@code null} if absent: |
468 * {@code null} if absent: |
469 * |
469 * |
470 * <pre> {@code |
470 * <pre> {@code |
471 * V oldValue = map.get(key); |
471 * V oldValue = map.get(key); |
472 * V newValue = (oldValue == null) ? value : |
472 * V newValue = (oldValue == null) ? value : |
473 * remappingFunction.apply(oldValue, value); |
473 * remappingFunction.apply(oldValue, value); |
474 * if (newValue == null) |
474 * if (newValue == null) |
475 * map.remove(key); |
|
476 * else if (oldValue == null) |
|
477 * map.remove(key); |
475 * map.remove(key); |
478 * else |
476 * else |
479 * map.put(key, newValue); |
477 * map.put(key, newValue); |
480 * }</pre> |
478 * }</pre> |
481 * |
479 * |