Package com.google.common.collect
Class Multisets.ViewMultiset<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- com.google.common.collect.AbstractMultiset<E>
-
- com.google.common.collect.Multisets.ViewMultiset<E>
-
- All Implemented Interfaces:
Multiset<E>
,java.lang.Iterable<E>
,java.util.Collection<E>
- Direct Known Subclasses:
Multisets.FilteredMultiset
- Enclosing class:
- Multisets
private abstract static class Multisets.ViewMultiset<E> extends AbstractMultiset<E>
AnAbstractMultiset
with additional default implementations, some of them linear-time implementations in terms ofelementSet
andentrySet
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.collect.AbstractMultiset
AbstractMultiset.ElementSet, AbstractMultiset.EntrySet
-
Nested classes/interfaces inherited from interface com.google.common.collect.Multiset
Multiset.Entry<E>
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ViewMultiset()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
(package private) int
distinctElements()
java.util.Iterator<E>
iterator()
int
size()
Returns the total number of all occurrences of all elements in this multiset.-
Methods inherited from class com.google.common.collect.AbstractMultiset
add, add, addAll, contains, createElementSet, createEntrySet, elementIterator, elementSet, entryIterator, entrySet, equals, hashCode, isEmpty, remove, remove, removeAll, retainAll, setCount, setCount, toString
-
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, toArray, toArray
-
Methods inherited from interface com.google.common.collect.Multiset
containsAll, count, forEach, forEachEntry, spliterator
-
-
-
-
Method Detail
-
size
public int size()
Description copied from interface:Multiset
Returns the total number of all occurrences of all elements in this multiset.Note: this method does not return the number of distinct elements in the multiset, which is given by
entrySet().size()
.
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<E>
- Specified by:
clear
in classAbstractMultiset<E>
-
iterator
public java.util.Iterator<E> iterator()
Description copied from interface:Multiset
Elements that occur multiple times in the multiset will appear multiple times in this iterator, though not necessarily sequentially.
-
distinctElements
int distinctElements()
- Specified by:
distinctElements
in classAbstractMultiset<E>
-
-