/** * 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. */ private int put(char[] key, int value) { int length = this.keyTable.length, index = CharOperation.hashCode(key) % length; while (this.keyTable[index] != null) { if (CharOperation.equals(this.keyTable[index], key)) return this.valueTable[index] = value; if (++index == length) { // faster than modulo 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 it wasn't there already, * 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 the given key in the hashtable * @param value the given value * @return int the old value of the key, or -value if it did not have one. */ public int putIfAbsent(char[] key, int value) { int length = this.keyTable.length, index = CharOperation.hashCode(key) % length; while (this.keyTable[index] != null) { if (CharOperation.equals(this.keyTable[index], key)) return this.valueTable[index]; if (++index == length) { // faster than modulo 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 (value is assumed to be > 0) }
/** * Puts the specified element into the hashtable if it wasn't there already, * 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 the given key in the hashtable * @param value the given value * @return int the old value of the key, or -value if it did not have one. */ public int putIfAbsent(char[] key, int value) { int length = this.keyTable.length, index = CharOperation.hashCode(key) % length; while (this.keyTable[index] != null) { if (CharOperation.equals(this.keyTable[index], key)) return this.valueTable[index]; if (++index == length) { // faster than modulo 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 (value is assumed to be > 0) }
/** * Puts the specified element into the hashtable if it wasn't there already, * 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 the given key in the hashtable * @param value the given value * @return int the old value of the key, or -value if it did not have one. */ public int putIfAbsent(char[] key, int value) { int length = this.keyTable.length, index = CharOperation.hashCode(key) % length; while (this.keyTable[index] != null) { if (CharOperation.equals(this.keyTable[index], key)) return this.valueTable[index]; if (++index == length) { // faster than modulo 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 (value is assumed to be > 0) }
/** * Puts the specified element into the hashtable if it wasn't there already, * 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 the given key in the hashtable * @param value the given value * @return int the old value of the key, or -value if it did not have one. */ public int putIfAbsent(char[] key, int value) { int length = this.keyTable.length, index = CharOperation.hashCode(key) % length; while (this.keyTable[index] != null) { if (CharOperation.equals(this.keyTable[index], key)) return this.valueTable[index]; if (++index == length) { // faster than modulo 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 (value is assumed to be > 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. * 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. */ private int put(char[] key, int value) { int length = this.keyTable.length, index = CharOperation.hashCode(key) % length; while (this.keyTable[index] != null) { if (CharOperation.equals(this.keyTable[index], key)) return this.valueTable[index] = value; if (++index == length) { // faster than modulo 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 it wasn't there already, * 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 the given key in the hashtable * @param value the given value * @return int the old value of the key, or -value if it did not have one. */ public int putIfAbsent(char[] key, int value) { int length = this.keyTable.length, index = CharOperation.hashCode(key) % length; while (this.keyTable[index] != null) { if (CharOperation.equals(this.keyTable[index], key)) return this.valueTable[index]; if (++index == length) { // faster than modulo 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 (value is assumed to be > 0) }
/** * Puts the specified element into the hashtable if it wasn't there already, * 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 the given key in the hashtable * @param value the given value * @return int the old value of the key, or -value if it did not have one. */ public int putIfAbsent(char[] key, int value) { int length = this.keyTable.length, index = CharOperation.hashCode(key) % length; while (this.keyTable[index] != null) { if (CharOperation.equals(this.keyTable[index], key)) return this.valueTable[index]; if (++index == length) { // faster than modulo 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 (value is assumed to be > 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. * 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. */ private int put(char[] key, int value) { int length = this.keyTable.length, index = CharOperation.hashCode(key) % length; while (this.keyTable[index] != null) { if (CharOperation.equals(this.keyTable[index], key)) return this.valueTable[index] = value; if (++index == length) { // faster than modulo 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. */ private int put(char[] key, int value) { int length = this.keyTable.length, index = CharOperation.hashCode(key) % length; while (this.keyTable[index] != null) { if (CharOperation.equals(this.keyTable[index], key)) return this.valueTable[index] = value; if (++index == length) { // faster than modulo 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 it wasn't there already, * 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 the given key in the hashtable * @param value the given value * @return int the old value of the key, or -value if it did not have one. */ public int putIfAbsent(char[] key, int value) { int length = this.keyTable.length, index = CharOperation.hashCode(key) % length; while (this.keyTable[index] != null) { if (CharOperation.equals(this.keyTable[index], key)) return this.valueTable[index]; if (++index == length) { // faster than modulo 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 (value is assumed to be > 0) }
/** * Puts the specified element into the hashtable if it wasn't there already, * 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 the given key in the hashtable * @param value the given value * @return int the old value of the key, or -value if it did not have one. */ public int putIfAbsent(char[] key, int value) { int length = this.keyTable.length, index = CharOperation.hashCode(key) % length; while (this.keyTable[index] != null) { if (CharOperation.equals(this.keyTable[index], key)) return this.valueTable[index]; if (++index == length) { // faster than modulo 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 (value is assumed to be > 0) }
/** * Puts the specified element into the hashtable if it wasn't there already, * 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 the given key in the hashtable * @param value the given value * @return int the old value of the key, or -value if it did not have one. */ public int putIfAbsent(char[] key, int value) { int length = this.keyTable.length, index = CharOperation.hashCode(key) % length; while (this.keyTable[index] != null) { if (CharOperation.equals(this.keyTable[index], key)) return this.valueTable[index]; if (++index == length) { // faster than modulo 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 (value is assumed to be > 0) }
/** * Puts the specified element into the hashtable if it wasn't there already, * 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 the given key in the hashtable * @param value the given value * @return int the old value of the key, or -value if it did not have one. */ public int putIfAbsent(char[] key, int value) { int length = this.keyTable.length, index = CharOperation.hashCode(key) % length; while (this.keyTable[index] != null) { if (CharOperation.equals(this.keyTable[index], key)) return this.valueTable[index]; if (++index == length) { // faster than modulo 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 (value is assumed to be > 0) }
/** * Puts the specified element into the hashtable if it wasn't there already, * 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 the given key in the hashtable * @param value the given value * @return int the old value of the key, or -value if it did not have one. */ public int putIfAbsent(char[] key, int value) { int length = this.keyTable.length, index = CharOperation.hashCode(key) % length; while (this.keyTable[index] != null) { if (CharOperation.equals(this.keyTable[index], key)) return this.valueTable[index]; if (++index == length) { // faster than modulo 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 (value is assumed to be > 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. * 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. */ private int put(char[] key, int value) { int length = this.keyTable.length, index = CharOperation.hashCode(key) % length; while (this.keyTable[index] != null) { if (CharOperation.equals(this.keyTable[index], key)) return this.valueTable[index] = value; if (++index == length) { // faster than modulo 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. */ private int put(char[] key, int value) { int length = this.keyTable.length, index = CharOperation.hashCode(key) % length; while (this.keyTable[index] != null) { if (CharOperation.equals(this.keyTable[index], key)) return this.valueTable[index] = value; if (++index == length) { // faster than modulo 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. */ private int put(char[] key, int value) { int length = this.keyTable.length, index = CharOperation.hashCode(key) % length; while (this.keyTable[index] != null) { if (CharOperation.equals(this.keyTable[index], key)) return this.valueTable[index] = value; if (++index == length) { // faster than modulo 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. */ private int put(char[] key, int value) { int length = this.keyTable.length, index = CharOperation.hashCode(key) % length; while (this.keyTable[index] != null) { if (CharOperation.equals(this.keyTable[index], key)) return this.valueTable[index] = value; if (++index == length) { // faster than modulo 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. */ private int put(char[] key, int value) { int length = this.keyTable.length, index = CharOperation.hashCode(key) % length; while (this.keyTable[index] != null) { if (CharOperation.equals(this.keyTable[index], key)) return this.valueTable[index] = value; if (++index == length) { // faster than modulo 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; } /**