@Override public boolean removeAll(final IntCollection c) { synchronized (sync) { return collection.removeAll(c); } } @Override
@Override public boolean removeAll(final Collection<?> c) { synchronized (sync) { return collection.removeAll(c); } } @Override
@Override public C remove(final Object key) { final C result = decorated.remove(key); if (result != null) { allValues.removeAll(result); } return result; }
@Override public C put(final K key, final C value) { final C result = decorated.put(key, value); if (result != null) { allValues.removeAll(result); } allValues.addAll(value); return result; }
/** * Removes given values mapped to a given key. * * @param key * The key to remove the given mapped value for. * @param values * The values to remove from the {@link IntCollection} of values mapped to the given * key. * @return {@code true} if at least one value was successfully removed. */ public boolean removeValues(final K key, final IntCollection values) { final boolean result; final C keyValues = decorated.get(key); if (values == null) { result = false; } else { result = keyValues.remove(values); if (result) { allValues.removeAll(values); } } return result; }