@Override public boolean containsEntry(short key, long 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(short key, long value) { int index = index(key); if (index >= 0) { // key is present return values[index] == value; } else { // key is absent return false; } }
@Override public double getOrDefault(short key, double defaultValue) { int index = index(key); if (index >= 0) { // key is present return Double.longBitsToDouble(values[index]); } else { // key is absent return defaultValue; } }
@Override public Double get(Object key) { int index = index((Short) key); if (index >= 0) { // key is present return Double.longBitsToDouble(values[index]); } else { // key is absent return null; } }
@Override public Double getOrDefault(Object key, Double defaultValue) { int index = index((Short) key); if (index >= 0) { // key is present return Double.longBitsToDouble(values[index]); } else { // key is absent return defaultValue; } }
@Override public boolean containsEntry(short key, double value) { int index = index(key); if (index >= 0) { // key is present return values[index] == Double.doubleToLongBits(value); } else { // key is absent return false; } }
@Override public double getOrDefault(short key, double defaultValue) { int index = index(key); if (index >= 0) { // key is present return Double.longBitsToDouble(values[index]); } else { // key is absent return defaultValue; } }
@Override public boolean containsEntry(short key, double value) { int index = index(key); if (index >= 0) { // key is present return values[index] == Double.doubleToLongBits(value); } else { // key is absent return false; } }
@Override public Double getOrDefault(Object key, Double defaultValue) { int index = index((Short) key); if (index >= 0) { // key is present return Double.longBitsToDouble(values[index]); } else { // key is absent return defaultValue; } }
@Override public Double get(Object key) { int index = index((Short) key); if (index >= 0) { // key is present return Double.longBitsToDouble(values[index]); } else { // key is absent return null; } }
@Override public Double replace(Short key, Double value) { int index = index(key); if (index >= 0) { // key is present long[] vals = values; double oldValue = Double.longBitsToDouble(vals[index]); vals[index] = Double.doubleToLongBits(value); return oldValue; } else { // key is absent return null; } }
@Override public Double replace(Short key, Double value) { int index = index(key); if (index >= 0) { // key is present long[] vals = values; double oldValue = Double.longBitsToDouble(vals[index]); vals[index] = Double.doubleToLongBits(value); return oldValue; } else { // key is absent return null; } }
@Override public boolean replace(short key, double oldValue, double newValue) { int index = index(key); if (index >= 0) { // key is present long[] vals = values; if (vals[index] == Double.doubleToLongBits(oldValue)) { vals[index] = Double.doubleToLongBits(newValue); return true; } else { return false; } } else { // key is absent return false; } }
@Override public boolean replace(short key, double oldValue, double newValue) { int index = index(key); if (index >= 0) { // key is present long[] vals = values; if (vals[index] == Double.doubleToLongBits(oldValue)) { vals[index] = Double.doubleToLongBits(newValue); return true; } else { return false; } } else { // key is absent return false; } }
@Override public double get(short key) { int index = index(key); if (index >= 0) { // key is present return Double.longBitsToDouble(values[index]); } else { // key is absent return defaultValue(); } }
@Override public double get(short key) { int index = index(key); if (index >= 0) { // key is present return Double.longBitsToDouble(values[index]); } else { // key is absent return defaultValue(); } }
@Override public double replace(short key, double value) { int index = index(key); if (index >= 0) { // key is present long[] vals = values; double oldValue = Double.longBitsToDouble(vals[index]); vals[index] = Double.doubleToLongBits(value); return oldValue; } else { // key is absent return defaultValue(); } }
@Override public double replace(short key, double value) { int index = index(key); if (index >= 0) { // key is present long[] vals = values; double oldValue = Double.longBitsToDouble(vals[index]); vals[index] = Double.doubleToLongBits(value); return oldValue; } else { // key is absent return defaultValue(); } }
@Override public double computeIfPresent(short key, ShortDoubleToDoubleFunction remappingFunction) { if (remappingFunction == null) throw new java.lang.NullPointerException(); int index = index(key); if (index >= 0) { // key is present long[] vals = values; double newValue = remappingFunction.applyAsDouble(key, Double.longBitsToDouble(vals[index])); vals[index] = Double.doubleToLongBits(newValue); return newValue; } else { // key is absent return defaultValue(); } }
@Override public double computeIfPresent(short key, ShortDoubleToDoubleFunction remappingFunction) { if (remappingFunction == null) throw new java.lang.NullPointerException(); int index = index(key); if (index >= 0) { // key is present long[] vals = values; double newValue = remappingFunction.applyAsDouble(key, Double.longBitsToDouble(vals[index])); vals[index] = Double.doubleToLongBits(newValue); return newValue; } else { // key is absent return defaultValue(); } }