@Override public boolean removeAll(Collection<?> c) { return removeAllImpl(this, c); }
/** * A sensible definition of {@link #removeAll} in terms of {@link #iterator} and {@link #remove}. * If you override {@code iterator} or {@code remove}, you may wish to override {@link #removeAll} * to forward to this implementation. * * @since 7.0 (this version overrides the {@code ForwardingCollection} version as of 12.0) */ @Override protected boolean standardRemoveAll(Collection<?> collection) { return Sets.removeAllImpl(this, checkNotNull(collection)); // for GWT }
@Override public boolean removeAll(Collection<?> c) { return removeAllImpl(this, c); }
@Override public boolean removeAll(Collection<?> c) { return removeAllImpl(this, c); }
/** * A sensible definition of {@link #removeAll} in terms of {@link #iterator} and {@link #remove}. * If you override {@code iterator} or {@code remove}, you may wish to override {@link #removeAll} * to forward to this implementation. * * @since 7.0 (this version overrides the {@code ForwardingCollection} version as of 12.0) */ @Override protected boolean standardRemoveAll(Collection<?> collection) { return Sets.removeAllImpl(this, checkNotNull(collection)); // for GWT }
@Override public boolean removeAll(Collection<?> c) { try { return super.removeAll(checkNotNull(c)); } catch (UnsupportedOperationException e) { // if the iterators don't support remove return Sets.removeAllImpl(this, c.iterator()); } }
/** * A sensible definition of {@link #removeAll} in terms of {@link #iterator} and {@link #remove}. * If you override {@code iterator} or {@code remove}, you may wish to override {@link #removeAll} * to forward to this implementation. * * @since 7.0 (this version overrides the {@code ForwardingCollection} version as of 12.0) */ @Override protected boolean standardRemoveAll(Collection<?> collection) { return Sets.removeAllImpl(this, checkNotNull(collection)); // for GWT }
static boolean removeAllImpl(Set<?> set, Collection<?> collection) { checkNotNull(collection); // for GWT if (collection instanceof Multiset) { collection = ((Multiset<?>) collection).elementSet(); } /* * AbstractSet.removeAll(List) has quadratic behavior if the list size * is just more than the set's size. We augment the test by * assuming that sets have fast contains() performance, and other * collections don't. See * http://code.google.com/p/guava-libraries/issues/detail?id=1013 */ if (collection instanceof Set && collection.size() > set.size()) { return Iterators.removeAll(set.iterator(), collection); } else { return removeAllImpl(set, collection.iterator()); } }
@Override public boolean removeAll(Collection<?> c) { try { return super.removeAll(checkNotNull(c)); } catch (UnsupportedOperationException e) { // if the iterators don't support remove return Sets.removeAllImpl(this, c.iterator()); } }
@Override public boolean removeAll(Collection<?> c) { try { return super.removeAll(checkNotNull(c)); } catch (UnsupportedOperationException e) { // if the iterators don't support remove return Sets.removeAllImpl(this, c.iterator()); } }
static boolean removeAllImpl(Set<?> set, Collection<?> collection) { checkNotNull(collection); // for GWT if (collection instanceof Multiset) { collection = ((Multiset<?>) collection).elementSet(); } /* * AbstractSet.removeAll(List) has quadratic behavior if the list size * is just more than the set's size. We augment the test by * assuming that sets have fast contains() performance, and other * collections don't. See * http://code.google.com/p/guava-libraries/issues/detail?id=1013 */ if (collection instanceof Set && collection.size() > set.size()) { return Iterators.removeAll(set.iterator(), collection); } else { return removeAllImpl(set, collection.iterator()); } }
static final class UnmodifiableNavigableSet<E> extends ForwardingSortedSet<E> implements NavigableSet<E>, Serializable { private final NavigableSet<E> delegate; private final SortedSet<E> unmodifiableDelegate; UnmodifiableNavigableSet(NavigableSet<E> delegate) { this.delegate = checkNotNull(delegate); this.unmodifiableDelegate = Collections.unmodifiableSortedSet(delegate); } @Override protected SortedSet<E> delegate() { return unmodifiableDelegate; } @Override public E lower(E e) { return delegate.lower(e); } @Override public E floor(E e) { return delegate.floor(e); } @Override public E ceiling(E e) { return delegate.ceiling(e); }
@Override public boolean removeAll(Collection<?> c) { return removeAllImpl(this, c); }
@Override public boolean removeAll(Collection<?> c) { return removeAllImpl(this, c); }
@Override public boolean removeAll(Collection<?> c) { return removeAllImpl(this, c); }
@Override public boolean removeAll(Collection<?> c) { return removeAllImpl(this, c); }
/** * A sensible definition of {@link #removeAll} in terms of {@link #iterator} * and {@link #remove}. If you override {@code iterator} or {@code remove}, * you may wish to override {@link #removeAll} to forward to this * implementation. * * @since 7.0 (this version overrides the {@code ForwardingCollection} version as of 12.0) */ @Override protected boolean standardRemoveAll(Collection<?> collection) { return Sets.removeAllImpl(this, checkNotNull(collection)); // for GWT }
/** * A sensible definition of {@link #removeAll} in terms of {@link #iterator} and {@link #remove}. * If you override {@code iterator} or {@code remove}, you may wish to override {@link #removeAll} * to forward to this implementation. * * @since 7.0 (this version overrides the {@code ForwardingCollection} version as of 12.0) */ @Override protected boolean standardRemoveAll(Collection<?> collection) { return Sets.removeAllImpl(this, checkNotNull(collection)); // for GWT }
/** * A sensible definition of {@link #removeAll} in terms of {@link #iterator} * and {@link #remove}. If you override {@code iterator} or {@code remove}, * you may wish to override {@link #removeAll} to forward to this * implementation. * * @since 7.0 (this version overrides the {@code ForwardingCollection} version as of 12.0) */ @Override protected boolean standardRemoveAll(Collection<?> collection) { return Sets.removeAllImpl(this, checkNotNull(collection)); // for GWT }
@Override public boolean removeAll(Collection<?> c) { try { return super.removeAll(checkNotNull(c)); } catch (UnsupportedOperationException e) { // if the iterators don't support remove return Sets.removeAllImpl(this, c.iterator()); } }