/** * {@inheritDoc} */ @Override public boolean contains(int key) { if (((key) == 0)) { return hasEmptyKey; } else { final int [] keys = this.keys; final int mask = this.mask; int slot = hashKey(key) & mask; int existing; while (!((existing = keys[slot]) == 0)) { if (((existing) == ( key))) { return true; } slot = (slot + 1) & mask; } return false; } }
final int idealSlot = hashKey(existing); final int shift = (slot - idealSlot) & mask; if (shift >= distance) {
} else { final int[] keys = this.keys; int slot = hashKey(key) & mask;
/** * Rehash from old buffers to new buffers. */ protected void rehash(int[] fromKeys) { assert HashContainers.checkPowerOfTwo(fromKeys.length - 1); // Rehash all stored keys into the new buffers. final int[] keys = this.keys; final int mask = this.mask; int existing; for (int i = fromKeys.length - 1; --i >= 0;) { if (!((existing = fromKeys[i]) == 0)) { int slot = hashKey(existing) & mask; while (!((keys[slot]) == 0)) { slot = (slot + 1) & mask; } keys[slot] = existing; } } }
/** * An alias for the (preferred) {@link #removeAll}. */ public boolean remove(int key) { if (((key) == 0)) { boolean hadEmptyKey = hasEmptyKey; hasEmptyKey = false; return hadEmptyKey; } else { final int [] keys = this.keys; final int mask = this.mask; int slot = hashKey(key) & mask; int existing; while (!((existing = keys[slot]) == 0)) { if (((existing) == ( key))) { shiftConflictingKeys(slot); return true; } slot = (slot + 1) & mask; } return false; } }
final int [] keys = this.keys; final int mask = this.mask; int slot = hashKey(key) & mask;
/** * {@inheritDoc} */ @Override public boolean contains(int key) { if (((key) == 0)) { return hasEmptyKey; } else { final int [] keys = this.keys; final int mask = this.mask; int slot = hashKey(key) & mask; int existing; while (!((existing = keys[slot]) == 0)) { if (((existing) == ( key))) { return true; } slot = (slot + 1) & mask; } return false; } }
final int idealSlot = hashKey(existing); final int shift = (slot - idealSlot) & mask; if (shift >= distance) {
} else { final int[] keys = this.keys; int slot = hashKey(key) & mask;
/** * Rehash from old buffers to new buffers. */ protected void rehash(int[] fromKeys) { assert HashContainers.checkPowerOfTwo(fromKeys.length - 1); // Rehash all stored keys into the new buffers. final int[] keys = this.keys; final int mask = this.mask; int existing; for (int i = fromKeys.length - 1; --i >= 0;) { if (!((existing = fromKeys[i]) == 0)) { int slot = hashKey(existing) & mask; while (!((keys[slot]) == 0)) { slot = (slot + 1) & mask; } keys[slot] = existing; } } }
/** * An alias for the (preferred) {@link #removeAll}. */ public boolean remove(int key) { if (((key) == 0)) { boolean hadEmptyKey = hasEmptyKey; hasEmptyKey = false; return hadEmptyKey; } else { final int [] keys = this.keys; final int mask = this.mask; int slot = hashKey(key) & mask; int existing; while (!((existing = keys[slot]) == 0)) { if (((existing) == ( key))) { shiftConflictingKeys(slot); return true; } slot = (slot + 1) & mask; } return false; } }
final int [] keys = this.keys; final int mask = this.mask; int slot = hashKey(key) & mask;