/** {@inheritDoc} */ @Override public int computeIfPresent(final float k, final java.util.function.BiFunction<? super Float, ? super Integer, ? extends Integer> remappingFunction) { java.util.Objects.requireNonNull(remappingFunction); final int pos = find(k); if (pos < 0) return defRetValue; final Integer newValue = remappingFunction.apply(Float.valueOf(k), Integer.valueOf(value[pos])); if (newValue == null) { if ((Float.floatToIntBits(k) == 0)) removeNullEntry(); else removeEntry(pos); return defRetValue; } return value[pos] = (newValue).intValue(); } /** {@inheritDoc} */
@Override public int remove(final float k) { if ((Float.floatToIntBits(k) == 0)) { if (containsNullKey) return removeNullEntry(); return defRetValue; } float curr; final float[] key = this.key; int pos; // The starting point. if ((Float.floatToIntBits( curr = key[pos = it.unimi.dsi.fastutil.HashCommon.mix(it.unimi.dsi.fastutil.HashCommon.float2int(k)) & mask]) == 0)) return defRetValue; if ((Float.floatToIntBits(k) == Float.floatToIntBits(curr))) return removeEntry(pos); while (true) { if ((Float.floatToIntBits(curr = key[pos = (pos + 1) & mask]) == 0)) return defRetValue; if ((Float.floatToIntBits(k) == Float.floatToIntBits(curr))) return removeEntry(pos); } } @Override
return false; if ((Float.floatToIntBits(k) == Float.floatToIntBits(curr)) && ((v) == (value[pos]))) { removeEntry(pos); return true; return false; if ((Float.floatToIntBits(k) == Float.floatToIntBits(curr)) && ((v) == (value[pos]))) { removeEntry(pos); return true;
/** {@inheritDoc} */ @Override public int merge(final float 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 ((Float.floatToIntBits(k) == 0)) removeNullEntry(); else removeEntry(pos); return defRetValue; } return value[pos] = (newValue).intValue(); } /*
/** {@inheritDoc} */ @Override public int compute(final float k, final java.util.function.BiFunction<? super Float, ? super Integer, ? extends Integer> remappingFunction) { java.util.Objects.requireNonNull(remappingFunction); final int pos = find(k); final Integer newValue = remappingFunction.apply(Float.valueOf(k), pos >= 0 ? Integer.valueOf(value[pos]) : null); if (newValue == null) { if (pos >= 0) { if ((Float.floatToIntBits(k) == 0)) 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} */