/** Returns the key's current value and increments the stored value. If the key is not in the map, defaultValue + increment is * put into the map. */ public int getAndIncrement (K key, int defaultValue, int increment) { int hashCode = System.identityHashCode(key); int index = hashCode & mask; if (key != keyTable[index]) { index = hash2(hashCode); if (key != keyTable[index]) { index = hash3(hashCode); if (key != keyTable[index]) return getAndIncrementStash(key, defaultValue, increment); } } int value = valueTable[index]; valueTable[index] = value + increment; return value; }
/** Returns the key's current value and increments the stored value. If the key is not in the map, defaultValue + increment is * put into the map. */ public int getAndIncrement (K key, int defaultValue, int increment) { int hashCode = System.identityHashCode(key); int index = hashCode & mask; if (key != keyTable[index]) { index = hash2(hashCode); if (key != keyTable[index]) { index = hash3(hashCode); if (key != keyTable[index]) { if (isBigTable) { index = hash4(hashCode); if (key != keyTable[index]) return getAndIncrementStash(key, defaultValue, increment); } else { return getAndIncrementStash(key, defaultValue, increment); } } } } int value = valueTable[index]; valueTable[index] = value + increment; return value; }
/** Returns the key's current value and increments the stored value. If the key is not in the map, defaultValue + increment is * put into the map. */ public int getAndIncrement (K key, int defaultValue, int increment) { int hashCode = System.identityHashCode(key); int index = hashCode & mask; if (key != keyTable[index]) { index = hash2(hashCode); if (key != keyTable[index]) { index = hash3(hashCode); if (key != keyTable[index]) return getAndIncrementStash(key, defaultValue, increment); } } int value = valueTable[index]; valueTable[index] = value + increment; return value; }
/** Returns the key's current value and increments the stored value. If the key is not in the map, defaultValue + increment is * put into the map. */ public int getAndIncrement (K key, int defaultValue, int increment) { int hashCode = System.identityHashCode(key); int index = hashCode & mask; if (key != keyTable[index]) { index = hash2(hashCode); if (key != keyTable[index]) { index = hash3(hashCode); if (key != keyTable[index]) { if (isBigTable) { index = hash4(hashCode); if (key != keyTable[index]) return getAndIncrementStash(key, defaultValue, increment); } else { return getAndIncrementStash(key, defaultValue, increment); } } } } int value = valueTable[index]; valueTable[index] = value + increment; return value; }