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