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