/** * Puts the specified element into the hashtable, using the specified * key. The element may be retrieved by doing a get() with the same key. * The key and the element cannot be null. * * @param key <CODE>Object</CODE> the specified key in the hashtable * @param value <CODE>int</CODE> the specified element * @return int the old value of the key, or -1 if it did not have one. */ public int put(Object key, int value) { int index = hashCode(key), length = this.keyTable.length; while (this.keyTable[index] != null) { if (this.keyTable[index] == key) return this.valueTable[index] = value; if (++index == length) { index = 0; } } this.keyTable[index] = key; this.valueTable[index] = value; // assumes the threshold is never equal to the size of the table if (++this.elementSize > this.threshold) rehash(); return value; } /**
/** * Puts the specified element into the hashtable, using the specified * key. The element may be retrieved by doing a get() with the same key. * The key and the element cannot be null. * * @param key <CODE>Object</CODE> the specified key in the hashtable * @param value <CODE>int</CODE> the specified element * @return int the old value of the key, or -1 if it did not have one. */ public int put(Object key, int value) { int index = hashCode(key), length = this.keyTable.length; while (this.keyTable[index] != null) { if (this.keyTable[index] == key) return this.valueTable[index] = value; if (++index == length) { index = 0; } } this.keyTable[index] = key; this.valueTable[index] = value; // assumes the threshold is never equal to the size of the table if (++this.elementSize > this.threshold) rehash(); return value; } /**
/** * Puts the specified element into the hashtable, using the specified * key. The element may be retrieved by doing a get() with the same key. * The key and the element cannot be null. * * @param key <CODE>Object</CODE> the specified key in the hashtable * @param value <CODE>int</CODE> the specified element * @return int the old value of the key, or -1 if it did not have one. */ public int put(Object key, int value) { int index = hashCode(key), length = this.keyTable.length; while (this.keyTable[index] != null) { if (this.keyTable[index] == key) return this.valueTable[index] = value; if (++index == length) { index = 0; } } this.keyTable[index] = key; this.valueTable[index] = value; // assumes the threshold is never equal to the size of the table if (++this.elementSize > this.threshold) rehash(); return value; } /**
/** * Puts the specified element into the hashtable, using the specified * key. The element may be retrieved by doing a get() with the same key. * The key and the element cannot be null. * * @param key <CODE>Object</CODE> the specified key in the hashtable * @param value <CODE>int</CODE> the specified element * @return int the old value of the key, or -1 if it did not have one. */ public int put(Object key, int value) { int index = hashCode(key), length = this.keyTable.length; while (this.keyTable[index] != null) { if (this.keyTable[index] == key) return this.valueTable[index] = value; if (++index == length) { index = 0; } } this.keyTable[index] = key; this.valueTable[index] = value; // assumes the threshold is never equal to the size of the table if (++this.elementSize > this.threshold) rehash(); return value; } /**
/** * Puts the specified element into the hashtable, using the specified * key. The element may be retrieved by doing a get() with the same key. * The key and the element cannot be null. * * @param key <CODE>Object</CODE> the specified key in the hashtable * @param value <CODE>int</CODE> the specified element * @return int the old value of the key, or -1 if it did not have one. */ public int put(Object key, int value) { int index = hashCode(key), length = this.keyTable.length; while (this.keyTable[index] != null) { if (this.keyTable[index] == key) return this.valueTable[index] = value; if (++index == length) { index = 0; } } this.keyTable[index] = key; this.valueTable[index] = value; // assumes the threshold is never equal to the size of the table if (++this.elementSize > this.threshold) rehash(); return value; } /**
/** * Puts the specified element into the hashtable, using the specified * key. The element may be retrieved by doing a get() with the same key. * The key and the element cannot be null. * * @param key <CODE>Object</CODE> the specified key in the hashtable * @param value <CODE>int</CODE> the specified element * @return int the old value of the key, or -1 if it did not have one. */ public int put(Object key, int value) { int index = hashCode(key), length = this.keyTable.length; while (this.keyTable[index] != null) { if (this.keyTable[index] == key) return this.valueTable[index] = value; if (++index == length) { index = 0; } } this.keyTable[index] = key; this.valueTable[index] = value; // assumes the threshold is never equal to the size of the table if (++this.elementSize > this.threshold) rehash(); return value; } /**
/** * Puts the specified element into the hashtable, using the specified * key. The element may be retrieved by doing a get() with the same key. * The key and the element cannot be null. * * @param key <CODE>Object</CODE> the specified key in the hashtable * @param value <CODE>int</CODE> the specified element * @return int the old value of the key, or -1 if it did not have one. */ public int put(Object key, int value) { int index = hashCode(key), length = this.keyTable.length; while (this.keyTable[index] != null) { if (this.keyTable[index] == key) return this.valueTable[index] = value; if (++index == length) { index = 0; } } this.keyTable[index] = key; this.valueTable[index] = value; // assumes the threshold is never equal to the size of the table if (++this.elementSize > this.threshold) rehash(); return value; } /**
/** * Puts the specified element into the hashtable, using the specified * key. The element may be retrieved by doing a get() with the same key. * The key and the element cannot be null. * * @param key <CODE>Object</CODE> the specified key in the hashtable * @param value <CODE>int</CODE> the specified element * @return int the old value of the key, or -1 if it did not have one. */ public int put(Object key, int value) { int index = hashCode(key), length = this.keyTable.length; while (this.keyTable[index] != null) { if (this.keyTable[index] == key) return this.valueTable[index] = value; if (++index == length) { index = 0; } } this.keyTable[index] = key; this.valueTable[index] = value; // assumes the threshold is never equal to the size of the table if (++this.elementSize > this.threshold) rehash(); return value; } /**
/** * Puts the specified element into the hashtable, using the specified * key. The element may be retrieved by doing a get() with the same key. * The key and the element cannot be null. * * @param key <CODE>Object</CODE> the specified key in the hashtable * @param value <CODE>int</CODE> the specified element * @return int the old value of the key, or -1 if it did not have one. */ public int put(Object key, int value) { int index = hashCode(key), length = this.keyTable.length; while (this.keyTable[index] != null) { if (this.keyTable[index] == key) return this.valueTable[index] = value; if (++index == length) { index = 0; } } this.keyTable[index] = key; this.valueTable[index] = value; // assumes the threshold is never equal to the size of the table if (++this.elementSize > this.threshold) rehash(); return value; } /**
/** * Puts the specified element into the hashtable, using the specified * key. The element may be retrieved by doing a get() with the same key. * The key and the element cannot be null. * * @param key <CODE>Object</CODE> the specified key in the hashtable * @param value <CODE>int</CODE> the specified element * @return int the old value of the key, or -1 if it did not have one. */ public int put(Object key, int value) { int index = hashCode(key), length = this.keyTable.length; while (this.keyTable[index] != null) { if (this.keyTable[index] == key) return this.valueTable[index] = value; if (++index == length) { index = 0; } } this.keyTable[index] = key; this.valueTable[index] = value; // assumes the threshold is never equal to the size of the table if (++this.elementSize > this.threshold) rehash(); return value; } /**
/** * Puts the specified element into the hashtable, using the specified * key. The element may be retrieved by doing a get() with the same key. * The key and the element cannot be null. * * @param key <CODE>Object</CODE> the specified key in the hashtable * @param value <CODE>int</CODE> the specified element * @return int the old value of the key, or -1 if it did not have one. */ public int put(Object key, int value) { int index = hashCode(key), length = this.keyTable.length; while (this.keyTable[index] != null) { if (this.keyTable[index] == key) return this.valueTable[index] = value; if (++index == length) { index = 0; } } this.keyTable[index] = key; this.valueTable[index] = value; // assumes the threshold is never equal to the size of the table if (++this.elementSize > this.threshold) rehash(); return value; } /**