public Object put(int key, Object value) { int length = this.keyTable.length, index = key % length; int currentKey; while ((currentKey = this.keyTable[index]) != 0) { if (currentKey == 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; } private void rehash() {
public Object put(int key, Object value) { int length = this.keyTable.length, index = key % length; int currentKey; while ((currentKey = this.keyTable[index]) != 0) { if (currentKey == 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; } private void rehash() {
public Object put(int key, Object value) { int length = this.keyTable.length, index = key % length; int currentKey; while ((currentKey = this.keyTable[index]) != 0) { if (currentKey == 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; } private void rehash() {
public Object put(int key, Object value) { int length = this.keyTable.length, index = key % length; int currentKey; while ((currentKey = this.keyTable[index]) != 0) { if (currentKey == 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; } private void rehash() {
public Object put(int key, Object value) { int length = this.keyTable.length, index = key % length; int currentKey; while ((currentKey = this.keyTable[index]) != 0) { if (currentKey == 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; } private void rehash() {
public Object put(int key, Object value) { int length = this.keyTable.length, index = key % length; int currentKey; while ((currentKey = this.keyTable[index]) != 0) { if (currentKey == 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; } private void rehash() {
public Object put(int key, Object value) { int length = this.keyTable.length, index = key % length; int currentKey; while ((currentKey = this.keyTable[index]) != 0) { if (currentKey == 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; } private void rehash() {
public Object put(int key, Object value) { int length = this.keyTable.length, index = key % length; int currentKey; while ((currentKey = this.keyTable[index]) != 0) { if (currentKey == 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; } private void rehash() {
public Object put(int key, Object value) { int length = this.keyTable.length, index = key % length; int currentKey; while ((currentKey = this.keyTable[index]) != 0) { if (currentKey == 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; } private void rehash() {
public Object put(int key, Object value) { int length = this.keyTable.length, index = key % length; int currentKey; while ((currentKey = this.keyTable[index]) != 0) { if (currentKey == 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; } private void rehash() {
public Object put(int key, Object value) { int length = this.keyTable.length, index = key % length; int currentKey; while ((currentKey = this.keyTable[index]) != 0) { if (currentKey == 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; } private void rehash() {