@Override public boolean containsEntry(long key, short value) { int index = index(key); if (index >= 0) { // key is present return values[index] == value; } else { // key is absent return false; } }
@Override public boolean containsEntry(long key, short value) { int index = index(key); if (index >= 0) { // key is present return values[index] == value; } else { // key is absent return false; } }
@Override public short getOrDefault(double key, short defaultValue) { long k = Double.doubleToLongBits(key); int index = index(k); if (index >= 0) { // key is present return values[index]; } else { // key is absent return defaultValue; } }
@Override public boolean containsEntry(double key, short value) { long k = Double.doubleToLongBits(key); int index = index(k); if (index >= 0) { // key is present return values[index] == value; } else { // key is absent return false; } }
@Override public short getOrDefault(double key, short defaultValue) { long k = Double.doubleToLongBits(key); int index = index(k); if (index >= 0) { // key is present return values[index]; } else { // key is absent return defaultValue; } }
@Override public boolean containsEntry(double key, short value) { long k = Double.doubleToLongBits(key); int index = index(k); if (index >= 0) { // key is present return values[index] == value; } else { // key is absent return false; } }
@Override public Short get(Object key) { long k = Double.doubleToLongBits((Double) key); int index = index(k); if (index >= 0) { // key is present return values[index]; } else { // key is absent return null; } }
@Override public Short getOrDefault(Object key, Short defaultValue) { long k = Double.doubleToLongBits((Double) key); int index = index(k); if (index >= 0) { // key is present return values[index]; } else { // key is absent return defaultValue; } }
@Override public Short get(Object key) { long k = Double.doubleToLongBits((Double) key); int index = index(k); if (index >= 0) { // key is present return values[index]; } else { // key is absent return null; } }
@Override public Short getOrDefault(Object key, Short defaultValue) { long k = Double.doubleToLongBits((Double) key); int index = index(k); if (index >= 0) { // key is present return values[index]; } else { // key is absent return defaultValue; } }
@Override public Short replace(Double key, Short value) { long k = Double.doubleToLongBits(key); int index = index(k); if (index >= 0) { // key is present short[] vals = values; short oldValue = vals[index]; vals[index] = value; return oldValue; } else { // key is absent return null; } }
@Override public Short replace(Double key, Short value) { long k = Double.doubleToLongBits(key); int index = index(k); if (index >= 0) { // key is present short[] vals = values; short oldValue = vals[index]; vals[index] = value; return oldValue; } else { // key is absent return null; } }
@Override public boolean replace(double key, short oldValue, short newValue) { long k = Double.doubleToLongBits(key); int index = index(k); if (index >= 0) { // key is present short[] vals = values; if (vals[index] == oldValue) { vals[index] = newValue; return true; } else { return false; } } else { // key is absent return false; } }
@Override public short get(double key) { long k = Double.doubleToLongBits(key); int index = index(k); if (index >= 0) { // key is present return values[index]; } else { // key is absent return defaultValue(); } }
@Override public short get(double key) { long k = Double.doubleToLongBits(key); int index = index(k); if (index >= 0) { // key is present return values[index]; } else { // key is absent return defaultValue(); } }
@Override public short replace(double key, short value) { long k = Double.doubleToLongBits(key); int index = index(k); if (index >= 0) { // key is present short[] vals = values; short oldValue = vals[index]; vals[index] = value; return oldValue; } else { // key is absent return defaultValue(); } }
@Override public short replace(double key, short value) { long k = Double.doubleToLongBits(key); int index = index(k); if (index >= 0) { // key is present short[] vals = values; short oldValue = vals[index]; vals[index] = value; return oldValue; } else { // key is absent return defaultValue(); } }
public Short computeIfPresent(Double key, BiFunction<? super Double, ? super Short, ? extends Short> remappingFunction) { long k = Double.doubleToLongBits(key); if (remappingFunction == null) throw new java.lang.NullPointerException(); int index = index(k); if (index >= 0) { // key is present short[] vals = values; Short newValue = remappingFunction.apply(Double.longBitsToDouble(k), vals[index]); if (newValue != null) { vals[index] = newValue; return newValue; } else { throw new java.lang.UnsupportedOperationException("ComputeIfPresent operation of updatable map doesn't support removals"); } } else { // key is absent return null; } }
@Override public short computeIfPresent(double key, DoubleShortToShortFunction remappingFunction) { long k = Double.doubleToLongBits(key); if (remappingFunction == null) throw new java.lang.NullPointerException(); int index = index(k); if (index >= 0) { // key is present short[] vals = values; short newValue = remappingFunction.applyAsShort(Double.longBitsToDouble(k), vals[index]); vals[index] = newValue; return newValue; } else { // key is absent return defaultValue(); } }
@Override public short computeIfPresent(double key, DoubleShortToShortFunction remappingFunction) { long k = Double.doubleToLongBits(key); if (remappingFunction == null) throw new java.lang.NullPointerException(); int index = index(k); if (index >= 0) { // key is present short[] vals = values; short newValue = remappingFunction.applyAsShort(Double.longBitsToDouble(k), vals[index]); vals[index] = newValue; return newValue; } else { // key is absent return defaultValue(); } }