@Override public Byte getOrDefault(Object key, Byte defaultValue) { int index = index((Short) key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return defaultValue; } }
@Override public Byte get(Object key) { int index = index((Short) key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return null; } }
@Override public byte getOrDefault(short key, byte defaultValue) { int index = index(key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return defaultValue; } }
@Override public byte getOrDefault(short key, byte defaultValue) { int index = index(key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return defaultValue; } }
@Override public boolean containsEntry(short key, byte value) { int index = index(key); if (index >= 0) { // key is present return values[index] == value; } else { // key is absent return false; } }
@Override public Byte get(Object key) { int index = index((Short) key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return null; } }
@Override public boolean containsEntry(short key, byte value) { int index = index(key); if (index >= 0) { // key is present return values[index] == value; } else { // key is absent return false; } }
@Override public Byte getOrDefault(Object key, Byte defaultValue) { int index = index((Short) key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return defaultValue; } }
@Override public Byte replace(Short key, Byte value) { int index = index(key); if (index >= 0) { // key is present byte[] vals = values; byte oldValue = vals[index]; vals[index] = value; return oldValue; } else { // key is absent return null; } }
@Override public boolean replace(short key, byte oldValue, byte newValue) { int index = index(key); if (index >= 0) { // key is present byte[] vals = values; if (vals[index] == oldValue) { vals[index] = newValue; return true; } else { return false; } } else { // key is absent return false; } }
@Override public Byte replace(Short key, Byte value) { int index = index(key); if (index >= 0) { // key is present byte[] vals = values; byte oldValue = vals[index]; vals[index] = value; return oldValue; } else { // key is absent return null; } }
@Override public boolean replace(short key, byte oldValue, byte newValue) { int index = index(key); if (index >= 0) { // key is present byte[] vals = values; if (vals[index] == oldValue) { vals[index] = newValue; return true; } else { return false; } } else { // key is absent return false; } }
@Override public byte get(short key) { int index = index(key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return defaultValue(); } }
@Override public Byte computeIfPresent(Short key, BiFunction<? super Short, ? super Byte, ? extends Byte> remappingFunction) { short k = key; if (remappingFunction == null) throw new java.lang.NullPointerException(); int index = index(k); if (index >= 0) { // key is present byte[] vals = values; Byte newValue = remappingFunction.apply(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 byte get(short key) { int index = index(key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return defaultValue(); } }
@Override public byte replace(short key, byte value) { int index = index(key); if (index >= 0) { // key is present byte[] vals = values; byte oldValue = vals[index]; vals[index] = value; return oldValue; } else { // key is absent return defaultValue(); } }
@Override public byte replace(short key, byte value) { int index = index(key); if (index >= 0) { // key is present byte[] vals = values; byte oldValue = vals[index]; vals[index] = value; return oldValue; } else { // key is absent return defaultValue(); } }
public Byte computeIfPresent(Short key, BiFunction<? super Short, ? super Byte, ? extends Byte> remappingFunction) { short k = key; if (remappingFunction == null) throw new java.lang.NullPointerException(); int index = index(k); if (index >= 0) { // key is present byte[] vals = values; Byte newValue = remappingFunction.apply(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 byte computeIfPresent(short key, ShortByteToByteFunction remappingFunction) { if (remappingFunction == null) throw new java.lang.NullPointerException(); int index = index(key); if (index >= 0) { // key is present byte[] vals = values; byte newValue = remappingFunction.applyAsByte(key, vals[index]); vals[index] = newValue; return newValue; } else { // key is absent return defaultValue(); } }
@Override public byte computeIfPresent(short key, ShortByteToByteFunction remappingFunction) { if (remappingFunction == null) throw new java.lang.NullPointerException(); int index = index(key); if (index >= 0) { // key is present byte[] vals = values; byte newValue = remappingFunction.applyAsByte(key, vals[index]); vals[index] = newValue; return newValue; } else { // key is absent return defaultValue(); } }