/** * Remove a value from the map and return the value. * * @param keyPartA for the key * @param keyPartB for the key * @return the previous value if found otherwise null */ @SuppressWarnings("unchecked") public V remove(final int keyPartA, final int keyPartB) { final long key = compoundKey(keyPartA, keyPartB); final int mask = values.length - 1; int index = Hashing.hash(key, mask); Object value; while (null != (value = values[index])) { if (key == keys[index]) { values[index] = null; --size; compactChain(index); break; } index = ++index & mask; } return (V)value; }
/** * Remove a value from the map and return the value. * * @param keyPartA for the key * @param keyPartB for the key * @return the previous value if found otherwise null */ @SuppressWarnings("unchecked") public V remove(final int keyPartA, final int keyPartB) { final long key = compoundKey(keyPartA, keyPartB); final int mask = values.length - 1; int index = Hashing.hash(key, mask); Object value; while (null != (value = values[index])) { if (key == keys[index]) { values[index] = null; --size; compactChain(index); break; } index = ++index & mask; } return (V)value; }
/** * Remove a value from the map and return the value. * * @param keyPartA for the key * @param keyPartB for the key * @return the previous value if found otherwise null */ @SuppressWarnings("unchecked") public V remove(final int keyPartA, final int keyPartB) { final long key = compoundKey(keyPartA, keyPartB); final int mask = values.length - 1; int index = Hashing.hash(keyPartA, keyPartB, mask); Object value; while (null != (value = values[index])) { if (key == keys[index]) { values[index] = null; --size; compactChain(index); break; } index = ++index & mask; } return (V)value; }