/** * {@inheritDoc} */ @Override public double remove(int key) { final int mask = this.mask; if (((key) == 0)) { hasEmptyKey = false; double previousValue = values[mask + 1]; values[mask + 1] = 0d; return previousValue; } else { final int[] keys = this.keys; int slot = hashKey(key) & mask; int existing; while (!((existing = keys[slot]) == 0)) { if (((existing) == ( key))) { final double previousValue = values[slot]; shiftConflictingKeys(slot); return previousValue; } slot = (slot + 1) & mask; } return 0d; } }
/** * {@inheritDoc} */ @Override public int removeAll(IntPredicate predicate) { final int before = size(); if (hasEmptyKey) { if (predicate.apply(0)) { hasEmptyKey = false; values[mask + 1] = 0d; } } final int[] keys = this.keys; for (int slot = 0, max = this.mask; slot <= max;) { int existing; if (!((existing = keys[slot]) == 0) && predicate.apply(existing)) { // Shift, do not increment slot. shiftConflictingKeys(slot); } else { slot++; } } return before - size(); }
/** * {@inheritDoc} */ @Override public int removeAll(IntDoublePredicate predicate) { final int before = size(); final int mask = this.mask; if (hasEmptyKey) { if (predicate.apply(0, values[mask + 1])) { hasEmptyKey = false; values[mask + 1] = 0d; } } final int[] keys = this.keys; final double[] values = this.values; for (int slot = 0; slot <= mask;) { int existing; if (!((existing = keys[slot]) == 0) && predicate.apply(existing, values[slot])) { // Shift, do not increment slot. shiftConflictingKeys(slot); } else { slot++; } } return before - size(); }
if (!((existing = keys[slot]) == 0) && other.contains(existing)) { shiftConflictingKeys(slot); } else { slot++;
/** * {@inheritDoc} */ @Override public double remove(int key) { final int mask = this.mask; if (((key) == 0)) { hasEmptyKey = false; double previousValue = values[mask + 1]; values[mask + 1] = 0d; return previousValue; } else { final int[] keys = this.keys; int slot = hashKey(key) & mask; int existing; while (!((existing = keys[slot]) == 0)) { if (((existing) == ( key))) { final double previousValue = values[slot]; shiftConflictingKeys(slot); return previousValue; } slot = (slot + 1) & mask; } return 0d; } }
/** * {@inheritDoc} */ @Override public int removeAll(IntPredicate predicate) { final int before = size(); if (hasEmptyKey) { if (predicate.apply(0)) { hasEmptyKey = false; values[mask + 1] = 0d; } } final int[] keys = this.keys; for (int slot = 0, max = this.mask; slot <= max;) { int existing; if (!((existing = keys[slot]) == 0) && predicate.apply(existing)) { // Shift, do not increment slot. shiftConflictingKeys(slot); } else { slot++; } } return before - size(); }
/** * {@inheritDoc} */ @Override public int removeAll(IntDoublePredicate predicate) { final int before = size(); final int mask = this.mask; if (hasEmptyKey) { if (predicate.apply(0, values[mask + 1])) { hasEmptyKey = false; values[mask + 1] = 0d; } } final int[] keys = this.keys; final double[] values = this.values; for (int slot = 0; slot <= mask;) { int existing; if (!((existing = keys[slot]) == 0) && predicate.apply(existing, values[slot])) { // Shift, do not increment slot. shiftConflictingKeys(slot); } else { slot++; } } return before - size(); }
if (!((existing = keys[slot]) == 0) && other.contains(existing)) { shiftConflictingKeys(slot); } else { slot++;