public int put(Object key, int value) { Object _key = key; int _value = value; int index = findIndex(_key, keys); // if the key doesn't exist in the table if (keys[index] != _key) { if (++size > threshold) { rehash(); index = findIndex(_key, keys); } // insert the key and assign the value to -1 initially keys[index] = _key; values[index] = -1; } // insert value to where it needs to go, return the old value int result = values[index]; values[index] = _value; return result; }
public int put(Object key, int value) { Object _key = key; int _value = value; int index = findIndex(_key, keys); // if the key doesn't exist in the table if (keys[index] != _key) { if (++size > threshold) { rehash(); index = findIndex(_key, keys); } // insert the key and assign the value to -1 initially keys[index] = _key; values[index] = -1; } // insert value to where it needs to go, return the old value int result = values[index]; values[index] = _value; return result; }
public int put(Object key, int value) { Object _key = key; int _value = value; int index = findIndex(_key, keys); // if the key doesn't exist in the table if (keys[index] != _key) { if (++size > threshold) { rehash(); index = findIndex(_key, keys); } // insert the key and assign the value to -1 initially keys[index] = _key; values[index] = -1; } // insert value to where it needs to go, return the old value int result = values[index]; values[index] = _value; return result; }
public int put(Object key, int value) { Object _key = key; int _value = value; int index = findIndex(_key, keys); // if the key doesn't exist in the table if (keys[index] != _key) { if (++size > threshold) { rehash(); index = findIndex(_key, keys); } // insert the key and assign the value to -1 initially keys[index] = _key; values[index] = -1; } // insert value to where it needs to go, return the old value int result = values[index]; values[index] = _value; return result; }
public int put(Object key, int value) { Object _key = key; int _value = value; int index = findIndex(_key, keys); // if the key doesn't exist in the table if (keys[index] != _key) { if (++size > threshold) { rehash(); index = findIndex(_key, keys); } // insert the key and assign the value to -1 initially keys[index] = _key; values[index] = -1; } // insert value to where it needs to go, return the old value int result = values[index]; values[index] = _value; return result; }
public int put(Object key, int value) { Object _key = key; int _value = value; int index = findIndex(_key, keys); // if the key doesn't exist in the table if (keys[index] != _key) { if (++size > threshold) { rehash(); index = findIndex(_key, keys); } // insert the key and assign the value to -1 initially keys[index] = _key; values[index] = -1; } // insert value to where it needs to go, return the old value int result = values[index]; values[index] = _value; return result; }
public int put(Object key, int value) { Object _key = key; int _value = value; int index = findIndex(_key, keys); // if the key doesn't exist in the table if (keys[index] != _key) { if (++size > threshold) { rehash(); index = findIndex(_key, keys); } // insert the key and assign the value to -1 initially keys[index] = _key; values[index] = -1; } // insert value to where it needs to go, return the old value int result = values[index]; values[index] = _value; return result; }
public int put(Object key, int value) { Object _key = key; int _value = value; int index = findIndex(_key, keys); // if the key doesn't exist in the table if (keys[index] != _key) { if (++size > threshold) { rehash(); index = findIndex(_key, keys); } // insert the key and assign the value to -1 initially keys[index] = _key; values[index] = -1; } // insert value to where it needs to go, return the old value int result = values[index]; values[index] = _value; return result; }