return index; } else if (states[index] == FULL && keys[index] == key) { return changeIndexSign(index); return changeIndexSign(index); return firstRemoved; } else if (states[index] == FULL && keys[index] == key) { return changeIndexSign(index);
/** * Put a value associated with a key in the map. * @param key key to which value is associated * @param value value to put in the map * @return previous value associated with the key */ public T put(final int key, final T value) { int index = findInsertionIndex(key); T previous = missingEntries; boolean newMapping = true; if (index < 0) { index = changeIndexSign(index); previous = values[index]; newMapping = false; } keys[index] = key; states[index] = FULL; values[index] = value; if (newMapping) { ++size; if (shouldGrowTable()) { growTable(); } ++count; } return previous; }
return index; } else if (states[index] == FULL && keys[index] == key) { return changeIndexSign(index); return changeIndexSign(index); return firstRemoved; } else if (states[index] == FULL && keys[index] == key) { return changeIndexSign(index);
/** * Put a value associated with a key in the map. * @param key key to which value is associated * @param value value to put in the map * @return previous value associated with the key */ public T put(final int key, final T value) { int index = findInsertionIndex(key); T previous = missingEntries; boolean newMapping = true; if (index < 0) { index = changeIndexSign(index); previous = values[index]; newMapping = false; } keys[index] = key; states[index] = FULL; values[index] = value; if (newMapping) { ++size; if (shouldGrowTable()) { growTable(); } ++count; } return previous; }