Package com.google.common.collect
Interface SortedMultisetBridge<E>
- All Superinterfaces:
Collection<E>
,Iterable<E>
,Multiset<E>
- All Known Subinterfaces:
SortedMultiset<E>
- All Known Implementing Classes:
AbstractSortedMultiset
,DescendingImmutableSortedMultiset
,DescendingMultiset
,ForwardingSortedMultiset
,ForwardingSortedMultiset.StandardDescendingMultiset
,ImmutableSortedMultiset
,RegularImmutableSortedMultiset
,TreeMultiset
,UnmodifiableSortedMultiset
Superinterface of
SortedMultiset
to introduce a bridge method for elementSet()
,
to ensure binary compatibility with older Guava versions that specified elementSet()
to
return SortedSet
.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.common.collect.Multiset
Multiset.Entry<E>
-
Method Summary
Modifier and TypeMethodDescriptionReturns the set of distinct elements contained in this multiset.Methods inherited from interface java.util.Collection
addAll, clear, isEmpty, parallelStream, removeIf, stream, toArray, toArray, toArray
-
Method Details
-
elementSet
Description copied from interface:Multiset
Returns the set of distinct elements contained in this multiset. The element set is backed by the same data as the multiset, so any change to either is immediately reflected in the other. The order of the elements in the element set is unspecified.If the element set supports any removal operations, these necessarily cause all occurrences of the removed element(s) to be removed from the multiset. Implementations are not expected to support the add operations, although this is possible.
A common use for the element set is to find the number of distinct elements in the multiset:
elementSet().size()
.- Specified by:
elementSet
in interfaceMultiset<E>
- Returns:
- a view of the set of distinct elements in this multiset
-