@Override public float putIfAbsent(K key, float value) { int index = insert(key, Float.floatToIntBits(value)); if (index < 0) { // key was absent return defaultValue(); } else { // key is present return Float.intBitsToFloat(values[index]); } }
@Override public float putIfAbsent(K key, float value) { int index = insert(key, Float.floatToIntBits(value)); if (index < 0) { // key was absent return defaultValue(); } else { // key is present return Float.intBitsToFloat(values[index]); } }
@Override public float getFloat(Object key) { int index = index(key); if (index >= 0) { // key is present return Float.intBitsToFloat(values[index]); } else { // key is absent return defaultValue(); } }
@Override public float getFloat(Object key) { int index = index(key); if (index >= 0) { // key is present return Float.intBitsToFloat(values[index]); } else { // key is absent return defaultValue(); } }
@Override public float replace(K key, float value) { int index = index(key); if (index >= 0) { // key is present int[] vals = values; float oldValue = Float.intBitsToFloat(vals[index]); vals[index] = Float.floatToIntBits(value); return oldValue; } else { // key is absent return defaultValue(); } }
@Override public float put(K key, float value) { int index = insert(key, Float.floatToIntBits(value)); if (index < 0) { // key was absent return defaultValue(); } else { // key is present int[] vals = values; float prevValue = Float.intBitsToFloat(vals[index]); vals[index] = Float.floatToIntBits(value); return prevValue; } }
@Override public float put(K key, float value) { int index = insert(key, Float.floatToIntBits(value)); if (index < 0) { // key was absent return defaultValue(); } else { // key is present int[] vals = values; float prevValue = Float.intBitsToFloat(vals[index]); vals[index] = Float.floatToIntBits(value); return prevValue; } }
@Override public float replace(K key, float value) { int index = index(key); if (index >= 0) { // key is present int[] vals = values; float oldValue = Float.intBitsToFloat(vals[index]); vals[index] = Float.floatToIntBits(value); return oldValue; } else { // key is absent return defaultValue(); } }
@Override public float computeIfPresent(K key, ObjFloatToFloatFunction<? super K> remappingFunction) { if (remappingFunction == null) throw new java.lang.NullPointerException(); int index = index(key); if (index >= 0) { // key is present int[] vals = values; float newValue = remappingFunction.applyAsFloat(key, Float.intBitsToFloat(vals[index])); vals[index] = Float.floatToIntBits(newValue); return newValue; } else { // key is absent return defaultValue(); } }
@Override public float computeIfPresent(K key, ObjFloatToFloatFunction<? super K> remappingFunction) { if (remappingFunction == null) throw new java.lang.NullPointerException(); int index = index(key); if (index >= 0) { // key is present int[] vals = values; float newValue = remappingFunction.applyAsFloat(key, Float.intBitsToFloat(vals[index])); vals[index] = Float.floatToIntBits(newValue); return newValue; } else { // key is absent return defaultValue(); } }
float newValue = remappingFunction.applyAsFloat(null, defaultValue()); incrementModCount(); keys[index] = null;
float newValue = remappingFunction.applyAsFloat(null, defaultValue()); incrementModCount(); keys[index] = null;
float newValue = remappingFunction.applyAsFloat(key, defaultValue()); incrementModCount(); keys[index] = key;
float newValue = remappingFunction.applyAsFloat(key, defaultValue()); incrementModCount(); keys[index] = key;