@Beta protected class ForwardingMultiset.StandardElementSet extends AbstractSet<E>
A sensible implementation of Multiset.elementSet()
in terms of the following methods: ForwardingCollection.clear()
, ForwardingCollection.contains(java.lang.Object)
, ForwardingCollection.containsAll(java.util.Collection<?>)
, ForwardingMultiset.count(java.lang.Object)
, ForwardingCollection.isEmpty()
, the Set.size()
and Set.iterator()
methods of ForwardingMultiset.entrySet()
, and ForwardingMultiset.remove(Object,
int)
. In many situations, you may wish to override ForwardingMultiset.elementSet()
to forward to this implementation or a subclass thereof.
Constructor and Description |
---|
StandardElementSet()
Constructor for use by subclasses.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
boolean |
isEmpty() |
Iterator<E> |
iterator() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
equals, hashCode
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
parallelStream, removeIf, stream
public StandardElementSet()
Constructor for use by subclasses.
public void clear()
clear
in interface Collection<E>
clear
in interface Set<E>
clear
in class AbstractCollection<E>
public boolean contains(Object o)
contains
in interface Collection<E>
contains
in interface Set<E>
contains
in class AbstractCollection<E>
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<E>
containsAll
in interface Set<E>
containsAll
in class AbstractCollection<E>
public boolean isEmpty()
isEmpty
in interface Collection<E>
isEmpty
in interface Set<E>
isEmpty
in class AbstractCollection<E>
public boolean remove(Object o)
remove
in interface Collection<E>
remove
in interface Set<E>
remove
in class AbstractCollection<E>
public int size()
size
in interface Collection<E>
size
in interface Set<E>
size
in class AbstractCollection<E>
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<E>
removeAll
in interface Set<E>
removeAll
in class AbstractSet<E>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<E>
retainAll
in interface Set<E>
retainAll
in class AbstractCollection<E>