@Override public V getOrDefault(Object key, V defaultValue) { int index = index((Integer) key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return defaultValue; } }
@Override public V getOrDefault(Object key, V defaultValue) { int index = index((Integer) key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return defaultValue; } }
@Override public V get(Object key) { int index = index((Integer) key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return null; } }
@Override public V getOrDefault(int key, V defaultValue) { int index = index(key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return defaultValue; } }
@Override public V get(Object key) { int index = index((Integer) key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return null; } }
@Override public V get(int key) { int index = index(key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return null; } }
@Override public V get(int key) { int index = index(key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return null; } }
@Override public V getOrDefault(int key, V defaultValue) { int index = index(key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return defaultValue; } }
@Override public V replace(int key, V value) { int index = index(key); if (index >= 0) { // key is present V[] vals = values; V oldValue = vals[index]; vals[index] = value; return oldValue; } else { // key is absent return null; } }
@Override public V replace(Integer key, V value) { int index = index(key); if (index >= 0) { // key is present V[] vals = values; V oldValue = vals[index]; vals[index] = value; return oldValue; } else { // key is absent return null; } }
@Override public V replace(int key, V value) { int index = index(key); if (index >= 0) { // key is present V[] vals = values; V oldValue = vals[index]; vals[index] = value; return oldValue; } else { // key is absent return null; } }
@Override public V replace(Integer key, V value) { int index = index(key); if (index >= 0) { // key is present V[] vals = values; V oldValue = vals[index]; vals[index] = value; return oldValue; } else { // key is absent return null; } }
@Override public boolean containsEntry(int key, Object value) { int index = index(key); if (index >= 0) { // key is present return nullableValueEquals(values[index], (V) value); } else { // key is absent return false; } }
@Override public boolean containsEntry(int key, Object value) { int index = index(key); if (index >= 0) { // key is present return nullableValueEquals(values[index], (V) value); } else { // key is absent return false; } }
@Override public boolean replace(int key, V oldValue, V newValue) { int index = index(key); if (index >= 0) { // key is present V[] vals = values; if (nullableValueEquals(vals[index], (V) oldValue)) { vals[index] = newValue; return true; } else { return false; } } else { // key is absent return false; } }
@Override public boolean replace(int key, V oldValue, V newValue) { int index = index(key); if (index >= 0) { // key is present V[] vals = values; if (nullableValueEquals(vals[index], (V) oldValue)) { vals[index] = newValue; return true; } else { return false; } } else { // key is absent return false; } }
if (remappingFunction == null) throw new java.lang.NullPointerException(); int index = index(k); if (index >= 0) {
@Override public V computeIfPresent(int key, IntObjFunction<? super V, ? extends V> remappingFunction) { if (remappingFunction == null) throw new java.lang.NullPointerException(); int index = index(key); if (index >= 0) { // key is present V[] vals = values; V val; if ((val = vals[index]) != null) { V newValue = remappingFunction.apply(key, val); if (newValue != null) { vals[index] = newValue; return newValue; } else { incrementModCount(); set[index] = removedValue; vals[index] = null; postRemoveHook(); return null; } } else { return null; } } else { // key is absent return null; } }
@Override public V computeIfPresent(int key, IntObjFunction<? super V, ? extends V> remappingFunction) { if (remappingFunction == null) throw new java.lang.NullPointerException(); int index = index(key); if (index >= 0) { // key is present V[] vals = values; V val; if ((val = vals[index]) != null) { V newValue = remappingFunction.apply(key, val); if (newValue != null) { vals[index] = newValue; return newValue; } else { incrementModCount(); set[index] = removedValue; vals[index] = null; postRemoveHook(); return null; } } else { return null; } } else { // key is absent return null; } }
public V computeIfPresent(Integer key, BiFunction<? super Integer, ? super V, ? extends V> remappingFunction) { int k = key; if (remappingFunction == null) throw new java.lang.NullPointerException(); int index = index(k); if (index >= 0) { // key is present V[] vals = values; V val; if ((val = vals[index]) != null) { V newValue = remappingFunction.apply(k, val); if (newValue != null) { vals[index] = newValue; return newValue; } else { incrementModCount(); set[index] = removedValue; vals[index] = null; postRemoveHook(); return null; } } else { return null; } } else { // key is absent return null; } }