@Override public Character getOrDefault(Object key, Character 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, char value) { int index = index(key); if (index >= 0) { // key is present return values[index] == value; } else { // key is absent return false; } }
@Override public Character getOrDefault(Object key, Character defaultValue) { int index = index(key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return defaultValue; } }
@Override public Character get(Object key) { int index = index(key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return null; } }
@Override public char getOrDefault(Object key, char 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, char value) { int index = index(key); if (index >= 0) { // key is present return values[index] == value; } else { // key is absent return false; } }
@Override public Character get(Object key) { int index = index(key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return null; } }
@Override public char getOrDefault(Object key, char defaultValue) { int index = index(key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return defaultValue; } }
@Override public Character replace(K key, Character value) { int index = index(key); if (index >= 0) { // key is present char[] vals = values; char oldValue = vals[index]; vals[index] = value; return oldValue; } else { // key is absent return null; } }
@Override public Character replace(K key, Character value) { int index = index(key); if (index >= 0) { // key is present char[] vals = values; char oldValue = vals[index]; vals[index] = value; return oldValue; } else { // key is absent return null; } }
@Override public boolean replace(K key, char oldValue, char newValue) { int index = index(key); if (index >= 0) { // key is present char[] 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, char oldValue, char newValue) { int index = index(key); if (index >= 0) { // key is present char[] vals = values; if (vals[index] == oldValue) { vals[index] = newValue; return true; } else { return false; } } else { // key is absent return false; } }
@Override public char getChar(Object key) { int index = index(key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return defaultValue(); } }
@Override public char getChar(Object key) { int index = index(key); if (index >= 0) { // key is present return values[index]; } else { // key is absent return defaultValue(); } }
@Override public char replace(K key, char value) { int index = index(key); if (index >= 0) { // key is present char[] vals = values; char oldValue = vals[index]; vals[index] = value; return oldValue; } else { // key is absent return defaultValue(); } }
@Override public char replace(K key, char value) { int index = index(key); if (index >= 0) { // key is present char[] vals = values; char oldValue = vals[index]; vals[index] = value; return oldValue; } else { // key is absent return defaultValue(); } }
@Override public char computeIfPresent(K key, ObjCharToCharFunction<? super K> remappingFunction) { if (remappingFunction == null) throw new java.lang.NullPointerException(); int index = index(key); if (index >= 0) { // key is present char[] vals = values; char newValue = remappingFunction.applyAsChar(key, vals[index]); vals[index] = newValue; return newValue; } else { // key is absent return defaultValue(); } }
@Override public char computeIfPresent(K key, ObjCharToCharFunction<? super K> remappingFunction) { if (remappingFunction == null) throw new java.lang.NullPointerException(); int index = index(key); if (index >= 0) { // key is present char[] vals = values; char newValue = remappingFunction.applyAsChar(key, vals[index]); vals[index] = newValue; return newValue; } else { // key is absent return defaultValue(); } }
@Override public Character computeIfPresent(K key, BiFunction<? super K, ? super Character, ? extends Character> remappingFunction) { if (remappingFunction == null) throw new java.lang.NullPointerException(); int index = index(key); if (index >= 0) { // key is present char[] vals = values; Character newValue = remappingFunction.apply(key, vals[index]); if (newValue != null) { vals[index] = newValue; return newValue; } else { incrementModCount(); set[index] = REMOVED; postRemoveHook(); return null; } } else { // key is absent return null; } }
public Character computeIfPresent(K key, BiFunction<? super K, ? super Character, ? extends Character> remappingFunction) { if (remappingFunction == null) throw new java.lang.NullPointerException(); int index = index(key); if (index >= 0) { // key is present char[] vals = values; Character newValue = remappingFunction.apply(key, vals[index]); if (newValue != null) { vals[index] = newValue; return newValue; } else { incrementModCount(); set[index] = REMOVED; postRemoveHook(); return null; } } else { // key is absent return null; } }