public boolean remove(Object o){ return (IndirectMap.this.remove(o) != null); }
public boolean remove(Object o){ if (!(o instanceof Map.Entry)) { return false; } return (IndirectMap.this.remove(((Map.Entry)o).getKey()) != null); }
public boolean removeAll(Collection c){ boolean result = false; for (Iterator cs = c.iterator(); cs.hasNext(); ){ if (IndirectMap.this.remove(cs.next()) != null ) { result = true; } } return result; }
public boolean removeAll(Collection c){ boolean result = false; for (Iterator cs = c.iterator(); cs.hasNext(); ){ Object object = cs.next(); if ( ! (object instanceof Map.Entry)){ continue; } Object removed = IndirectMap.this.remove(((Map.Entry)object).getKey()); if (removed != null){ result = true; } } return result; }
@Override public synchronized V merge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction) { // Must trigger add events if tracked or uow. if (hasTrackedPropertyChangeListener()) { V oldValue = get(key); V newValue = (oldValue == null) ? value : remappingFunction.apply(oldValue, value); if (newValue == null) { remove(key); } else { put(key, newValue); } return newValue; } return getDelegate().merge(key, value, remappingFunction); }
@Override public synchronized V computeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction) { // Must trigger add events if tracked or uow. if (hasTrackedPropertyChangeListener()) { if (get(key) != null) { V oldValue = get(key); V newValue = remappingFunction.apply(key, oldValue); if (newValue != null) { put(key, newValue); return newValue; } remove(key); } return null; } return getDelegate().computeIfPresent(key, remappingFunction); }
@Override public synchronized V compute(K key, BiFunction<? super K,? super V,? extends V> remappingFunction) { // Must trigger add events if tracked or uow. if (hasTrackedPropertyChangeListener()) { V oldValue = get(key); V newValue = remappingFunction.apply(key, oldValue); if (oldValue != null ) { if (newValue != null) { put(key, newValue); return newValue; } remove(key); } else { if (newValue != null) { put(key, newValue); return newValue; } } return null; } return getDelegate().compute(key, remappingFunction); }