/** * {@inheritDoc} * * <p>If any entries for the specified {@code key} already exist in the multimap, their values are * changed in-place without affecting the iteration order. * * <p>The returned list is immutable and implements {@link java.util.RandomAccess}. */ @CanIgnoreReturnValue @Override public List<V> replaceValues(@Nullable K key, Iterable<? extends V> values) { List<V> oldValues = getCopy(key); ListIterator<V> keyValues = new ValueForKeyIterator(key); Iterator<? extends V> newValues = values.iterator(); // Replace existing values, if any. while (keyValues.hasNext() && newValues.hasNext()) { keyValues.next(); keyValues.set(newValues.next()); } // Remove remaining old values, if any. while (keyValues.hasNext()) { keyValues.next(); keyValues.remove(); } // Add remaining new values, if any. while (newValues.hasNext()) { keyValues.add(newValues.next()); } return oldValues; }
/** * {@inheritDoc} * * <p>The returned list is immutable and implements {@link java.util.RandomAccess}. */ @CanIgnoreReturnValue @Override public List<V> removeAll(@Nullable Object key) { List<V> oldValues = getCopy(key); removeAllNodes(key); return oldValues; }
/** * {@inheritDoc} * * <p>If any entries for the specified {@code key} already exist in the multimap, their values are * changed in-place without affecting the iteration order. * * <p>The returned list is immutable and implements {@link java.util.RandomAccess}. */ @CanIgnoreReturnValue @Override public List<V> replaceValues(@NullableDecl K key, Iterable<? extends V> values) { List<V> oldValues = getCopy(key); ListIterator<V> keyValues = new ValueForKeyIterator(key); Iterator<? extends V> newValues = values.iterator(); // Replace existing values, if any. while (keyValues.hasNext() && newValues.hasNext()) { keyValues.next(); keyValues.set(newValues.next()); } // Remove remaining old values, if any. while (keyValues.hasNext()) { keyValues.next(); keyValues.remove(); } // Add remaining new values, if any. while (newValues.hasNext()) { keyValues.add(newValues.next()); } return oldValues; }
/** * {@inheritDoc} * * <p>If any entries for the specified {@code key} already exist in the multimap, their values are * changed in-place without affecting the iteration order. * * <p>The returned list is immutable and implements {@link java.util.RandomAccess}. */ @CanIgnoreReturnValue @Override public List<V> replaceValues(@NullableDecl K key, Iterable<? extends V> values) { List<V> oldValues = getCopy(key); ListIterator<V> keyValues = new ValueForKeyIterator(key); Iterator<? extends V> newValues = values.iterator(); // Replace existing values, if any. while (keyValues.hasNext() && newValues.hasNext()) { keyValues.next(); keyValues.set(newValues.next()); } // Remove remaining old values, if any. while (keyValues.hasNext()) { keyValues.next(); keyValues.remove(); } // Add remaining new values, if any. while (newValues.hasNext()) { keyValues.add(newValues.next()); } return oldValues; }
/** * {@inheritDoc} * * <p>The returned list is immutable and implements {@link java.util.RandomAccess}. */ @CanIgnoreReturnValue @Override public List<V> removeAll(@NullableDecl Object key) { List<V> oldValues = getCopy(key); removeAllNodes(key); return oldValues; }
/** * {@inheritDoc} * * <p>The returned list is immutable and implements {@link java.util.RandomAccess}. */ @CanIgnoreReturnValue @Override public List<V> removeAll(@NullableDecl Object key) { List<V> oldValues = getCopy(key); removeAllNodes(key); return oldValues; }
/** * {@inheritDoc} * * <p>The returned list is immutable and implements * {@link java.util.RandomAccess}. */ public List<V> removeAll(@Nullable Object key) { List<V> oldValues = getCopy(key); removeAllNodes(key); return oldValues; }
/** * {@inheritDoc} * * <p>The returned list is immutable and implements * {@link java.util.RandomAccess}. */ public List<V> removeAll(@Nullable Object key) { List<V> oldValues = getCopy(key); removeAllNodes(key); return oldValues; }
/** * {@inheritDoc} * * <p>The returned list is immutable and implements * {@link java.util.RandomAccess}. */ @Override public List<V> removeAll(@Nullable Object key) { List<V> oldValues = getCopy(key); removeAllNodes(key); return oldValues; }
/** * {@inheritDoc} * * <p>The returned list is immutable and implements * {@link java.util.RandomAccess}. */ @Override public List<V> removeAll(@Nullable Object key) { List<V> oldValues = getCopy(key); removeAllNodes(key); return oldValues; }
/** * {@inheritDoc} * * <p>The returned list is immutable and implements * {@link java.util.RandomAccess}. */ public List<V> removeAll(@Nullable Object key) { List<V> oldValues = getCopy(key); removeAllNodes(key); return oldValues; }
/** * {@inheritDoc} * * <p>The returned list is immutable and implements * {@link java.util.RandomAccess}. */ @Override public List<V> removeAll(@Nullable Object key) { List<V> oldValues = getCopy(key); removeAllNodes(key); return oldValues; }
/** * {@inheritDoc} * * <p>The returned list is immutable and implements * {@link java.util.RandomAccess}. */ @Override public List<V> removeAll(@Nullable Object key) { List<V> oldValues = getCopy(key); removeAllNodes(key); return oldValues; }
/** * {@inheritDoc} * * <p>The returned list is immutable and implements * {@link java.util.RandomAccess}. */ @Override public List<V> removeAll(@Nullable Object key) { List<V> oldValues = getCopy(key); removeAllNodes(key); return oldValues; }
/** * {@inheritDoc} * * <p>The returned list is immutable and implements * {@link java.util.RandomAccess}. */ @Override public List<V> removeAll(@Nullable Object key) { List<V> oldValues = getCopy(key); removeAllNodes(key); return oldValues; }
/** * {@inheritDoc} * * <p>The returned list is immutable and implements * {@link java.util.RandomAccess}. */ public List<V> removeAll(@Nullable Object key) { List<V> oldValues = getCopy(key); removeAllNodes(key); return oldValues; }
/** * {@inheritDoc} * * <p>The returned list is immutable and implements * {@link java.util.RandomAccess}. */ @Override public List<V> removeAll(@Nullable Object key) { List<V> oldValues = getCopy(key); removeAllNodes(key); return oldValues; }
/** * {@inheritDoc} * * <p>The returned list is immutable and implements * {@link java.util.RandomAccess}. */ @Override public List<V> removeAll(@Nullable Object key) { List<V> oldValues = getCopy(key); removeAllNodes(key); return oldValues; }
/** * {@inheritDoc} * * <p>The returned list is immutable and implements {@link java.util.RandomAccess}. */ @CanIgnoreReturnValue @Override public List<V> removeAll(@NullableDecl Object key) { List<V> oldValues = getCopy(key); removeAllNodes(key); return oldValues; }
/** * {@inheritDoc} * * <p>The returned list is immutable and implements {@link java.util.RandomAccess}. */ @CanIgnoreReturnValue @Override public List<V> removeAll(@Nullable Object key) { List<V> oldValues = getCopy(key); removeAllNodes(key); return oldValues; }