@SuppressWarnings("cast") @Override public boolean remove(Object o) { return contains(o) && multiset().elementSet().remove(((Entry<?>) o).getElement()); }
@Override public boolean contains(@Nullable Object o) { if (o instanceof Entry) { @SuppressWarnings("cast") Entry<?> entry = (Entry<?>) o; if (entry.getCount() <= 0) { return false; } int count = multiset().count(entry.getElement()); return count == entry.getCount(); } return false; }
@Override public void clear() { multiset().clear(); } }
@Override public void clear() { multiset().clear(); } }
@Override public void clear() { multiset().clear(); } }
@Override public void clear() { multiset().clear(); } }
@Override public void clear() { multiset().clear(); } }
@Override public void clear() { multiset().clear(); } }
@Override public void clear() { multiset().clear(); } }
@Override public void clear() { multiset().clear(); } }
@Override public void clear() { multiset().clear(); } }
@Override public void clear() { multiset().clear(); } }
@SuppressWarnings("cast") @Override public boolean remove(Object object) { if (object instanceof Multiset.Entry) { Entry<?> entry = (Entry<?>) object; Object element = entry.getElement(); int entryCount = entry.getCount(); if (entryCount != 0) { // Safe as long as we never add a new entry, which we won't. @SuppressWarnings("unchecked") Multiset<Object> multiset = (Multiset) multiset(); return multiset.setCount(element, entryCount, 0); } } return false; }
@Override public boolean contains(@NullableDecl Object o) { if (o instanceof Entry) { /* * The GWT compiler wrongly issues a warning here. */ @SuppressWarnings("cast") Entry<?> entry = (Entry<?>) o; if (entry.getCount() <= 0) { return false; } int count = multiset().count(entry.getElement()); return count == entry.getCount(); } return false; }
@Override public void clear() { multiset().clear(); } }
@SuppressWarnings("cast") @Override public boolean remove(Object object) { if (object instanceof Multiset.Entry) { Entry<?> entry = (Entry<?>) object; Object element = entry.getElement(); int entryCount = entry.getCount(); if (entryCount != 0) { // Safe as long as we never add a new entry, which we won't. @SuppressWarnings("unchecked") Multiset<Object> multiset = (Multiset) multiset(); return multiset.setCount(element, entryCount, 0); } } return false; }
@Override public void clear() { multiset().clear(); } }
@SuppressWarnings("cast") @Override public boolean remove(Object object) { if (object instanceof Multiset.Entry) { Entry<?> entry = (Entry<?>) object; Object element = entry.getElement(); int entryCount = entry.getCount(); if (entryCount != 0) { // Safe as long as we never add a new entry, which we won't. @SuppressWarnings("unchecked") Multiset<Object> multiset = (Multiset) multiset(); return multiset.setCount(element, entryCount, 0); } } return false; }
@Override public boolean contains(@Nullable Object o) { if (o instanceof Entry) { /* * The GWT compiler wrongly issues a warning here. */ @SuppressWarnings("cast") Entry<?> entry = (Entry<?>) o; if (entry.getCount() <= 0) { return false; } int count = multiset().count(entry.getElement()); return count == entry.getCount(); } return false; }
@Override public void clear() { multiset().clear(); } }