/** Returns true if the collection contains an element for the key. * * @param key <CODE>double</CODE> the key that we are looking for * @return boolean */ public boolean containsKey(int key) { int index = hash(key), length = this.keyTable.length; while ((this.keyTable[index] != 0) || ((this.keyTable[index] == 0) &&(this.valueTable[index] != 0))) { if (this.keyTable[index] == key) return true; if (++index == length) { index = 0; } } return false; } /**
/** Returns true if the collection contains an element for the key. * * @param key <CODE>double</CODE> the key that we are looking for * @return boolean */ public boolean containsKey(int key) { int index = hash(key), length = this.keyTable.length; while ((this.keyTable[index] != 0) || ((this.keyTable[index] == 0) &&(this.valueTable[index] != 0))) { if (this.keyTable[index] == key) return true; if (++index == length) { index = 0; } } return false; } /**
/** Returns true if the collection contains an element for the key. * * @param key <CODE>double</CODE> the key that we are looking for * @return boolean */ public boolean containsKey(int key) { int index = hash(key), length = this.keyTable.length; while ((this.keyTable[index] != 0) || ((this.keyTable[index] == 0) &&(this.valueTable[index] != 0))) { if (this.keyTable[index] == key) return true; if (++index == length) { index = 0; } } return false; } /**
/** Returns true if the collection contains an element for the key. * * @param key <CODE>double</CODE> the key that we are looking for * @return boolean */ public boolean containsKey(int key) { int index = hash(key), length = this.keyTable.length; while ((this.keyTable[index] != 0) || ((this.keyTable[index] == 0) &&(this.valueTable[index] != 0))) { if (this.keyTable[index] == key) return true; if (++index == length) { index = 0; } } return false; } /**
/** Returns true if the collection contains an element for the key. * * @param key <CODE>double</CODE> the key that we are looking for * @return boolean */ public boolean containsKey(int key) { int index = hash(key), length = this.keyTable.length; while ((this.keyTable[index] != 0) || ((this.keyTable[index] == 0) &&(this.valueTable[index] != 0))) { if (this.keyTable[index] == key) return true; if (++index == length) { index = 0; } } return false; } /**
/** Returns true if the collection contains an element for the key. * * @param key <CODE>double</CODE> the key that we are looking for * @return boolean */ public boolean containsKey(int key) { int index = hash(key), length = this.keyTable.length; while ((this.keyTable[index] != 0) || ((this.keyTable[index] == 0) &&(this.valueTable[index] != 0))) { if (this.keyTable[index] == key) return true; if (++index == length) { index = 0; } } return false; } /**
/** Returns true if the collection contains an element for the key. * * @param key <CODE>double</CODE> the key that we are looking for * @return boolean */ public boolean containsKey(int key) { int index = hash(key), length = this.keyTable.length; while ((this.keyTable[index] != 0) || ((this.keyTable[index] == 0) &&(this.valueTable[index] != 0))) { if (this.keyTable[index] == key) return true; if (++index == length) { index = 0; } } return false; } /**
/** Returns true if the collection contains an element for the key. * * @param key <CODE>double</CODE> the key that we are looking for * @return boolean */ public boolean containsKey(int key) { int index = hash(key), length = this.keyTable.length; while ((this.keyTable[index] != 0) || ((this.keyTable[index] == 0) &&(this.valueTable[index] != 0))) { if (this.keyTable[index] == key) return true; if (++index == length) { index = 0; } } return false; } /**
/** Returns true if the collection contains an element for the key. * * @param key <CODE>double</CODE> the key that we are looking for * @return boolean */ public boolean containsKey(int key) { int index = hash(key), length = this.keyTable.length; while ((this.keyTable[index] != 0) || ((this.keyTable[index] == 0) &&(this.valueTable[index] != 0))) { if (this.keyTable[index] == key) return true; if (++index == length) { index = 0; } } return false; } /**
/** Returns true if the collection contains an element for the key. * * @param key <CODE>double</CODE> the key that we are looking for * @return boolean */ public boolean containsKey(int key) { int index = hash(key), length = this.keyTable.length; while ((this.keyTable[index] != 0) || ((this.keyTable[index] == 0) &&(this.valueTable[index] != 0))) { if (this.keyTable[index] == key) return true; if (++index == length) { index = 0; } } return false; } /**
/** Returns true if the collection contains an element for the key. * * @param key <CODE>double</CODE> the key that we are looking for * @return boolean */ public boolean containsKey(int key) { int index = hash(key), length = this.keyTable.length; while ((this.keyTable[index] != 0) || ((this.keyTable[index] == 0) &&(this.valueTable[index] != 0))) { if (this.keyTable[index] == key) return true; if (++index == length) { index = 0; } } return false; } /**
/** * Puts the specified element into the hashtable, using the specified * key. The element may be retrieved by doing a get() with the same key. * * @param key <CODE>int</CODE> the specified key in the hashtable * @param value <CODE>int</CODE> the specified element * @return int value */ public int put(int key, int value) { int index = hash(key), length = this.keyTable.length; while ((this.keyTable[index] != 0) || ((this.keyTable[index] == 0) && (this.valueTable[index] != 0))) { 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. * * @param key <CODE>int</CODE> the specified key in the hashtable * @param value <CODE>int</CODE> the specified element * @return int value */ public int put(int key, int value) { int index = hash(key), length = this.keyTable.length; while ((this.keyTable[index] != 0) || ((this.keyTable[index] == 0) && (this.valueTable[index] != 0))) { 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 if absent, using the specified * key. The element may be retrieved by doing a get() with the same key. * * @param key <CODE>int</CODE> the specified key in the hashtable * @param value <CODE>int</CODE> the specified element * @return int value */ public int putIfAbsent(int key, int value) { int index = hash(key), length = this.keyTable.length; while ((this.keyTable[index] != 0) || ((this.keyTable[index] == 0) && (this.valueTable[index] != 0))) { if (this.keyTable[index] == key) return this.valueTable[index]; 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; // negative when added, assumes value is > 0 } /**
/** * Puts the specified element into the hashtable, using the specified * key. The element may be retrieved by doing a get() with the same key. * * @param key <CODE>int</CODE> the specified key in the hashtable * @param value <CODE>int</CODE> the specified element * @return int value */ public int put(int key, int value) { int index = hash(key), length = this.keyTable.length; while ((this.keyTable[index] != 0) || ((this.keyTable[index] == 0) && (this.valueTable[index] != 0))) { 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. * * @param key <CODE>int</CODE> the specified key in the hashtable * @param value <CODE>int</CODE> the specified element * @return int value */ public int put(int key, int value) { int index = hash(key), length = this.keyTable.length; while ((this.keyTable[index] != 0) || ((this.keyTable[index] == 0) && (this.valueTable[index] != 0))) { 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 if absent, using the specified * key. The element may be retrieved by doing a get() with the same key. * * @param key <CODE>int</CODE> the specified key in the hashtable * @param value <CODE>int</CODE> the specified element * @return int value */ public int putIfAbsent(int key, int value) { int index = hash(key), length = this.keyTable.length; while ((this.keyTable[index] != 0) || ((this.keyTable[index] == 0) && (this.valueTable[index] != 0))) { if (this.keyTable[index] == key) return this.valueTable[index]; 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; // negative when added, assumes value is > 0 } /**
/** * Puts the specified element into the hashtable, using the specified * key. The element may be retrieved by doing a get() with the same key. * * @param key <CODE>int</CODE> the specified key in the hashtable * @param value <CODE>int</CODE> the specified element * @return int value */ public int put(int key, int value) { int index = hash(key), length = this.keyTable.length; while ((this.keyTable[index] != 0) || ((this.keyTable[index] == 0) && (this.valueTable[index] != 0))) { 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 if absent, using the specified * key. The element may be retrieved by doing a get() with the same key. * * @param key <CODE>int</CODE> the specified key in the hashtable * @param value <CODE>int</CODE> the specified element * @return int value */ public int putIfAbsent(int key, int value) { int index = hash(key), length = this.keyTable.length; while ((this.keyTable[index] != 0) || ((this.keyTable[index] == 0) && (this.valueTable[index] != 0))) { if (this.keyTable[index] == key) return this.valueTable[index]; 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; // negative when added, assumes value is > 0 } /**
/** * Puts the specified element into the hashtable, using the specified * key. The element may be retrieved by doing a get() with the same key. * * @param key <CODE>int</CODE> the specified key in the hashtable * @param value <CODE>int</CODE> the specified element * @return int value */ public int put(int key, int value) { int index = hash(key), length = this.keyTable.length; while ((this.keyTable[index] != 0) || ((this.keyTable[index] == 0) && (this.valueTable[index] != 0))) { 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; } /**