@Override public byte getOrDefault(Object 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(Object 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 boolean containsEntry(Object 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(key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return null; } }
@Override public byte getOrDefault(Object 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(Object 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 get(Object key) { int index = index(key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return null; } }
@Override public Byte getOrDefault(Object 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 replace(K 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 Byte replace(K 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(K 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 boolean replace(K 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 getByte(Object key) { int index = index(key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return defaultValue(); } }
@Override public byte getByte(Object key) { int index = index(key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return defaultValue(); } }
@Override public Byte computeIfPresent(K key, BiFunction<? super K, ? super Byte, ? extends Byte> 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.apply(key, 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 replace(K 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(K 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(K key, BiFunction<? super K, ? super Byte, ? extends Byte> 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.apply(key, 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(K key, ObjByteToByteFunction<? super K> 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(K key, ObjByteToByteFunction<? super K> 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(); } }