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:
java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.Set<E>
- Enclosing class:
- ForwardingMultiset<E>
@Beta protected class ForwardingMultiset.StandardElementSet extends java.util.AbstractSet<E>
A sensible implementation ofMultiset.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()
, theSet.size()
andSet.iterator()
methods ofForwardingMultiset.entrySet()
, andForwardingMultiset.remove(Object, int)
. In many situations, you may wish to overrideForwardingMultiset.elementSet()
to forward to this implementation or a subclass thereof.- Since:
- 10.0
-
-
Constructor Summary
Constructors Constructor Description StandardElementSet()
Constructor for use by subclasses.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
boolean
isEmpty()
java.util.Iterator<E>
iterator()
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
int
size()
-
-
-
Method Detail
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<E>
- Specified by:
clear
in interfacejava.util.Set<E>
- Overrides:
clear
in classjava.util.AbstractCollection<E>
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
contains
in interfacejava.util.Collection<E>
- Specified by:
contains
in interfacejava.util.Set<E>
- Overrides:
contains
in classjava.util.AbstractCollection<E>
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
- Specified by:
containsAll
in interfacejava.util.Collection<E>
- Specified by:
containsAll
in interfacejava.util.Set<E>
- Overrides:
containsAll
in classjava.util.AbstractCollection<E>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Collection<E>
- Specified by:
isEmpty
in interfacejava.util.Set<E>
- Overrides:
isEmpty
in classjava.util.AbstractCollection<E>
-
iterator
public java.util.Iterator<E> iterator()
- Specified by:
iterator
in interfacejava.util.Collection<E>
- Specified by:
iterator
in interfacejava.lang.Iterable<E>
- Specified by:
iterator
in interfacejava.util.Set<E>
- Specified by:
iterator
in classjava.util.AbstractCollection<E>
-
remove
public boolean remove(java.lang.Object o)
- Specified by:
remove
in interfacejava.util.Collection<E>
- Specified by:
remove
in interfacejava.util.Set<E>
- Overrides:
remove
in classjava.util.AbstractCollection<E>
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection<E>
- Specified by:
size
in interfacejava.util.Set<E>
- Specified by:
size
in classjava.util.AbstractCollection<E>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAll
in interfacejava.util.Collection<E>
- Specified by:
removeAll
in interfacejava.util.Set<E>
- Overrides:
removeAll
in classjava.util.AbstractSet<E>
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAll
in interfacejava.util.Collection<E>
- Specified by:
retainAll
in interfacejava.util.Set<E>
- Overrides:
retainAll
in classjava.util.AbstractCollection<E>
-
-