Package com.google.common.collect
Class ForwardingMultiset.StandardElementSet
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
com.google.common.collect.ForwardingMultiset.StandardElementSet
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,Set<E>
- Enclosing class:
ForwardingMultiset<E extends @Nullable Object>
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.- Since:
- 10.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
boolean
containsAll
(Collection<?> c) boolean
isEmpty()
iterator()
boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
Methods inherited from class java.util.AbstractSet
equals, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Constructor Details
-
StandardElementSet
public StandardElementSet()Constructor for use by subclasses.
-
-
Method Details
-
iterator
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<E extends @Nullable Object>
- Specified by:
clear
in interfaceSet<E extends @Nullable Object>
- Overrides:
clear
in classAbstractCollection<E extends @Nullable Object>
-
contains
- Specified by:
contains
in interfaceCollection<E extends @Nullable Object>
- Specified by:
contains
in interfaceSet<E extends @Nullable Object>
- Overrides:
contains
in classAbstractCollection<E extends @Nullable Object>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<E extends @Nullable Object>
- Specified by:
containsAll
in interfaceSet<E extends @Nullable Object>
- Overrides:
containsAll
in classAbstractCollection<E extends @Nullable Object>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<E extends @Nullable Object>
- Specified by:
isEmpty
in interfaceSet<E extends @Nullable Object>
- Overrides:
isEmpty
in classAbstractCollection<E extends @Nullable Object>
-
remove
- Specified by:
remove
in interfaceCollection<E extends @Nullable Object>
- Specified by:
remove
in interfaceSet<E extends @Nullable Object>
- Overrides:
remove
in classAbstractCollection<E extends @Nullable Object>
-
size
public int size()- Specified by:
size
in interfaceCollection<E extends @Nullable Object>
- Specified by:
size
in interfaceSet<E extends @Nullable Object>
- Specified by:
size
in classAbstractCollection<E extends @Nullable Object>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<E extends @Nullable Object>
- Specified by:
removeAll
in interfaceSet<E extends @Nullable Object>
- Overrides:
removeAll
in classAbstractSet<E extends @Nullable Object>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<E extends @Nullable Object>
- Specified by:
retainAll
in interfaceSet<E extends @Nullable Object>
- Overrides:
retainAll
in classAbstractCollection<E extends @Nullable Object>
-