Package com.google.common.collect
Interface SortedMultisetBridge<E>
-
- All Superinterfaces:
java.util.Collection<E>
,java.lang.Iterable<E>
,Multiset<E>
- All Known Subinterfaces:
SortedMultiset<E>
- All Known Implementing Classes:
AbstractSortedMultiset
,DescendingImmutableSortedMultiset
,DescendingMultiset
,ForwardingSortedMultiset
,ForwardingSortedMultiset.StandardDescendingMultiset
,ImmutableSortedMultiset
,RegularImmutableSortedMultiset
,TreeMultiset
,UnmodifiableSortedMultiset
interface SortedMultisetBridge<E> extends Multiset<E>
Superinterface ofSortedMultiset
to introduce a bridge method forelementSet()
, to ensure binary compatibility with older Guava versions that specifiedelementSet()
to returnSortedSet
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.common.collect.Multiset
Multiset.Entry<E>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.SortedSet<E>
elementSet()
Returns the set of distinct elements contained in this multiset.
-
-
-
Method Detail
-
elementSet
java.util.SortedSet<E> 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
-
-