@Override public char putIfAbsent(K key, char value) { int index = insert(key, value); if (index < 0) { // key was absent return defaultValue(); } else { // key is present return values[index]; } }
@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 putIfAbsent(K key, char value) { int index = insert(key, value); if (index < 0) { // key was absent return defaultValue(); } else { // key is present return values[index]; } }
@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 put(K key, char value) { int index = insert(key, value); if (index < 0) { // key was absent return defaultValue(); } else { // key is present char[] vals = values; char prevValue = vals[index]; vals[index] = value; return prevValue; } }
@Override public char put(K key, char value) { int index = insert(key, value); if (index < 0) { // key was absent return defaultValue(); } else { // key is present char[] vals = values; char prevValue = vals[index]; vals[index] = value; return prevValue; } }
@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(); } }
char newValue = remappingFunction.applyAsChar(null, defaultValue()); incrementModCount(); keys[index] = null;
char newValue = remappingFunction.applyAsChar(null, defaultValue()); incrementModCount(); keys[index] = null;
char newValue = remappingFunction.applyAsChar(key, defaultValue()); incrementModCount(); keys[index] = key;
char newValue = remappingFunction.applyAsChar(key, defaultValue()); incrementModCount(); keys[index] = key;