/** * {@inheritDoc} */ @Override public VType remove(long key) { final int mask = this.mask; if (((key) == 0)) { hasEmptyKey = false; VType previousValue = (VType) values[mask + 1]; values[mask + 1] = null; return previousValue; } else { final long[] keys = this.keys; int slot = hashKey(key) & mask; long existing; while (!((existing = keys[slot]) == 0)) { if (((existing) == ( key))) { final VType previousValue = (VType) values[slot]; shiftConflictingKeys(slot); return previousValue; } slot = (slot + 1) & mask; } return null; } }
/** * {@inheritDoc} */ @Override public int removeAll(LongPredicate predicate) { final int before = size(); if (hasEmptyKey) { if (predicate.apply(0L)) { hasEmptyKey = false; values[mask + 1] = null; } } final long[] keys = this.keys; for (int slot = 0, max = this.mask; slot <= max;) { long 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(LongObjectPredicate<? super VType> predicate) { final int before = size(); final int mask = this.mask; if (hasEmptyKey) { if (predicate.apply(0L, (VType) values[mask + 1])) { hasEmptyKey = false; values[mask + 1] = null; } } final long[] keys = this.keys; final VType[] values = (VType[]) this.values; for (int slot = 0; slot <= mask;) { long 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 VType remove(long key) { final int mask = this.mask; if (((key) == 0)) { hasEmptyKey = false; VType previousValue = (VType) values[mask + 1]; values[mask + 1] = null; return previousValue; } else { final long[] keys = this.keys; int slot = hashKey(key) & mask; long existing; while (!((existing = keys[slot]) == 0)) { if (((existing) == ( key))) { final VType previousValue = (VType) values[slot]; shiftConflictingKeys(slot); return previousValue; } slot = (slot + 1) & mask; } return null; } }
/** * {@inheritDoc} */ @Override public int removeAll(LongPredicate predicate) { final int before = size(); if (hasEmptyKey) { if (predicate.apply(0L)) { hasEmptyKey = false; values[mask + 1] = null; } } final long[] keys = this.keys; for (int slot = 0, max = this.mask; slot <= max;) { long 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(LongObjectPredicate<? super VType> predicate) { final int before = size(); final int mask = this.mask; if (hasEmptyKey) { if (predicate.apply(0L, (VType) values[mask + 1])) { hasEmptyKey = false; values[mask + 1] = null; } } final long[] keys = this.keys; final VType[] values = (VType[]) this.values; for (int slot = 0; slot <= mask;) { long 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++;