@Override public float replace(char 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 get(char 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 putIfAbsent(char 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 get(char 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 putIfAbsent(char 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 replace(char 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(char 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(char 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 computeIfPresent(char key, CharFloatToFloatFunction 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(char key, CharFloatToFloatFunction 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 = defaultValue() + value; incrementModCount(); keys[index] = key;
float newValue = defaultValue() + value; incrementModCount(); keys[index] = key;
float newValue = remappingFunction.applyAsFloat(key, defaultValue()); incrementModCount(); keys[index] = key;
float newValue = remappingFunction.applyAsFloat(key, defaultValue()); incrementModCount(); keys[index] = key;