/** {@inheritDoc} */ @Override public int putIfAbsent(final K k, final int v) { final int pos = find(k); if (pos >= 0) return value[pos]; insert(-pos - 1, k, v); return defRetValue; } /** {@inheritDoc} */
@Override public int put(final K k, final int v) { final int pos = find(k); if (pos < 0) { insert(-pos - 1, k, v); return defRetValue; } final int oldValue = value[pos]; value[pos] = v; return oldValue; } private int addToValue(final int pos, final int incr) {
/** {@inheritDoc} */ @Override public int computeIntIfAbsent(final K k, final java.util.function.ToIntFunction<? super K> mappingFunction) { java.util.Objects.requireNonNull(mappingFunction); final int pos = find(k); if (pos >= 0) return value[pos]; final int newValue = mappingFunction.applyAsInt(k); insert(-pos - 1, k, newValue); return newValue; } /** {@inheritDoc} */
/** {@inheritDoc} */ @Override public int mergeInt(final K k, final int v, final java.util.function.BiFunction<? super Integer, ? super Integer, ? extends Integer> remappingFunction) { java.util.Objects.requireNonNull(remappingFunction); final int pos = find(k); if (pos < 0) { insert(-pos - 1, k, v); return v; } final Integer newValue = remappingFunction.apply(Integer.valueOf(value[pos]), Integer.valueOf(v)); if (newValue == null) { if (((k) == (null))) removeNullEntry(); else removeEntry(pos); return defRetValue; } return value[pos] = (newValue).intValue(); } /*
/** {@inheritDoc} */ @Override public int computeInt(final K k, final java.util.function.BiFunction<? super K, ? super Integer, ? extends Integer> remappingFunction) { java.util.Objects.requireNonNull(remappingFunction); final int pos = find(k); final Integer newValue = remappingFunction.apply((k), pos >= 0 ? Integer.valueOf(value[pos]) : null); if (newValue == null) { if (pos >= 0) { if (((k) == (null))) removeNullEntry(); else removeEntry(pos); } return defRetValue; } int newVal = (newValue).intValue(); if (pos < 0) { insert(-pos - 1, k, newVal); return newVal; } return value[pos] = newVal; } /** {@inheritDoc} */