/** {@inheritDoc} */ @Override public V computeIfPresent(final byte k, final java.util.function.BiFunction<? super Byte, ? super V, ? extends V> remappingFunction) { java.util.Objects.requireNonNull(remappingFunction); final int pos = find(k); if (pos < 0) return defRetValue; final V newValue = remappingFunction.apply(Byte.valueOf(k), (value[pos])); if (newValue == null) { if (((k) == ((byte) 0))) removeNullEntry(); else removeEntry(pos); return defRetValue; } return value[pos] = (newValue); } /** {@inheritDoc} */
/** {@inheritDoc} */ @Override public V compute(final byte k, final java.util.function.BiFunction<? super Byte, ? super V, ? extends V> remappingFunction) { java.util.Objects.requireNonNull(remappingFunction); final int pos = find(k); final V newValue = remappingFunction.apply(Byte.valueOf(k), pos >= 0 ? (value[pos]) : null); if (newValue == null) { if (pos >= 0) { if (((k) == ((byte) 0))) removeNullEntry(); else removeEntry(pos); } return defRetValue; } V newVal = (newValue); if (pos < 0) { insert(-pos - 1, k, newVal); return newVal; } return value[pos] = newVal; } /** {@inheritDoc} */
/** {@inheritDoc} */ @Override public V merge(final byte k, final V v, final java.util.function.BiFunction<? super V, ? super V, ? extends V> remappingFunction) { java.util.Objects.requireNonNull(remappingFunction); final int pos = find(k); if (pos < 0 || value[pos] == null) { if (v == null) return defRetValue; insert(-pos - 1, k, v); return v; } final V newValue = remappingFunction.apply((value[pos]), (v)); if (newValue == null) { if (((k) == ((byte) 0))) removeNullEntry(); else removeEntry(pos); return defRetValue; } return value[pos] = (newValue); } /*
/** {@inheritDoc} */ @Override public boolean remove(final byte k, final Object v) { if (((k) == ((byte) 0))) { if (containsNullKey && java.util.Objects.equals(v, value[n])) { removeNullEntry(); return true; } return false; } byte curr; final byte[] key = this.key; int pos; // The starting point. if (((curr = key[pos = (it.unimi.dsi.fastutil.HashCommon.mix((k))) & mask]) == ((byte) 0))) return false; if (((k) == (curr)) && java.util.Objects.equals(v, value[pos])) { removeEntry(pos); return true; } while (true) { if (((curr = key[pos = (pos + 1) & mask]) == ((byte) 0))) return false; if (((k) == (curr)) && java.util.Objects.equals(v, value[pos])) { removeEntry(pos); return true; } } } /** {@inheritDoc} */
@Override public V remove(final byte k) { if (((k) == ((byte) 0))) { if (containsNullKey) return removeNullEntry(); return defRetValue; } byte curr; final byte[] key = this.key; int pos; // The starting point. if (((curr = key[pos = (it.unimi.dsi.fastutil.HashCommon.mix((k))) & mask]) == ((byte) 0))) return defRetValue; if (((k) == (curr))) return removeEntry(pos); while (true) { if (((curr = key[pos = (pos + 1) & mask]) == ((byte) 0))) return defRetValue; if (((k) == (curr))) return removeEntry(pos); } } @Override