/** {@inheritDoc} */ @Override public short putIfAbsent(final K k, final short v) { final int pos = find(k); if (pos >= 0) return value[pos]; insert(-pos - 1, k, v); return defRetValue; } /** {@inheritDoc} */
@Override public short put(final K k, final short v) { final int pos = find(k); if (pos < 0) { insert(-pos - 1, k, v); return defRetValue; } final short oldValue = value[pos]; value[pos] = v; return oldValue; } private short addToValue(final int pos, final short incr) {
/** {@inheritDoc} */ @Override public short mergeShort(final K k, final short v, final java.util.function.BiFunction<? super Short, ? super Short, ? extends Short> remappingFunction) { java.util.Objects.requireNonNull(remappingFunction); final int pos = find(k); if (pos < 0) { insert(-pos - 1, k, v); return v; } final Short newValue = remappingFunction.apply(Short.valueOf(value[pos]), Short.valueOf(v)); if (newValue == null) { if (((k) == null)) removeNullEntry(); else removeEntry(pos); return defRetValue; } return value[pos] = (newValue).shortValue(); } /*
/** {@inheritDoc} */ @Override public short computeShortIfAbsent(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 short newValue = it.unimi.dsi.fastutil.SafeMath.safeIntToShort(mappingFunction.applyAsInt(k)); insert(-pos - 1, k, newValue); return newValue; } /** {@inheritDoc} */
/** {@inheritDoc} */ @Override public short computeShort(final K k, final java.util.function.BiFunction<? super K, ? super Short, ? extends Short> remappingFunction) { java.util.Objects.requireNonNull(remappingFunction); final int pos = find(k); final Short newValue = remappingFunction.apply((k), pos >= 0 ? Short.valueOf(value[pos]) : null); if (newValue == null) { if (pos >= 0) { if (((k) == null)) removeNullEntry(); else removeEntry(pos); } return defRetValue; } short newVal = (newValue).shortValue(); if (pos < 0) { insert(-pos - 1, k, newVal); return newVal; } return value[pos] = newVal; } /** {@inheritDoc} */