Warning
The methods of ForwardingSortedMultiset forward
indiscriminately to the methods of the delegate. For example, overriding add(Object, int) alone will not change the behavior of add(Object), which can
lead to unexpected behavior. In this case, you should override add(Object) as well,
either providing your own implementation, or delegating to the provided standardAdd
method.
default method warning: This class does not forward calls to default methods. Instead, it inherits their default implementations. When those implementations
invoke methods, they invoke methods on the ForwardingSortedMultiset.
The standard methods and any collection views they return are not guaranteed to be
thread-safe, even when all of the methods that they depend on are thread-safe.
| Modifier and Type | Class and Description |
|---|---|
| protected abstract class | ForwardingSortedMultiset.
A skeleton implementation of a descending multiset view. |
| protected class | ForwardingSortedMultiset.
A sensible implementation of |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public Comparator | comparator()
Implements com. Ordering#natural() if the natural
ordering of the elements is used.
|
| protected abstract SortedMultiset | delegate()
Implements abstract com. |
| public SortedMultiset | descendingMultiset()
Implements com. |
| public NavigableSet | elementSet()
Overrides com. Implements com. NavigableSet view of the distinct elements in this multiset.
|
| public Multiset. | firstEntry()
Implements com. null if this multiset is
empty.
|
| public SortedMultiset | headMultiset(E upperBound, BoundType boundType)
Implements com. upperBound,
optionally including upperBound itself.
|
| public Multiset. | lastEntry()
Implements com. null if this multiset is
empty.
|
| public Multiset. | pollFirstEntry()
Implements com. null if this multiset is empty.
|
| public Multiset. | pollLastEntry()
Implements com. null if this multiset is empty.
|
| protected Multiset. | |
| protected Multiset. | standardLastEntry()
A sensible definition of |
| protected Multiset. | standardPollFirstEntry()
A sensible definition of |
| protected Multiset. | standardPollLastEntry()
A sensible definition of |
| protected SortedMultiset | standardSubMultiset(E lowerBound, BoundType lowerBoundType, E upperBound, BoundType upperBoundType)
A sensible definition of |
| public SortedMultiset | subMultiset(E lowerBound, BoundType lowerBoundType, E upperBound, BoundType upperBoundType)
Implements com. lowerBound and upperBound.
|
| public SortedMultiset | tailMultiset(E lowerBound, BoundType boundType)
Implements com. lowerBound,
optionally including lowerBound itself.
|
| ForwardingSortedMultiset | back to summary |
|---|---|
| protected ForwardingSortedMultiset() Constructor for use by subclasses. | |
| comparator | back to summary |
|---|---|
| public Comparator Implements com. Doc from com. Returns the comparator that orders this multiset, or
| |
| delegate | back to summary |
|---|---|
| protected abstract SortedMultiset Implements abstract com. Doc from com. Returns the backing delegate instance that methods are forwarded to. Abstract subclasses
generally override this method with an abstract method that has a more specific return type,
such as
| |
| descendingMultiset | back to summary |
|---|---|
| public SortedMultiset Implements com. Doc from com. Returns a descending view of this multiset. Modifications made to either map will be reflected in the other.
| |
| elementSet | back to summary |
|---|---|
| public NavigableSet Overrides com. Implements com. Doc from com. Returns a
| |
| firstEntry | back to summary |
|---|---|
| public Multiset. Implements com. Doc from com. Returns the entry of the first element in this multiset, or
| |
| headMultiset | back to summary |
|---|---|
| public SortedMultiset Implements com. Doc from com. Returns a view of this multiset restricted to the elements less than The returned multiset will throw an
| |
| lastEntry | back to summary |
|---|---|
| public Multiset. Implements com. Doc from com. Returns the entry of the last element in this multiset, or
| |
| pollFirstEntry | back to summary |
|---|---|
| public Multiset. Implements com. Doc from com. Returns and removes the entry associated with the lowest element in this multiset, or returns
| |
| pollLastEntry | back to summary |
|---|---|
| public Multiset. Implements com. Doc from com. Returns and removes the entry associated with the greatest element in this multiset, or returns
| |
| standardFirstEntry | back to summary |
|---|---|
| protected Multiset. A sensible definition of If you override
| |
| standardLastEntry | back to summary |
|---|---|
| protected Multiset. A sensible definition of If you override
| |
| standardPollFirstEntry | back to summary |
|---|---|
| protected Multiset. A sensible definition of If you override
| |
| standardPollLastEntry | back to summary |
|---|---|
| protected Multiset. A sensible definition of If you override
| |
| standardSubMultiset | back to summary |
|---|---|
| protected SortedMultiset A sensible definition of If you override either of these methods, you may wish to override | |
| subMultiset | back to summary |
|---|---|
| public SortedMultiset Implements com. Doc from com. Returns a view of this multiset restricted to the range between The returned multiset will throw an This method is equivalent to
| |
| tailMultiset | back to summary |
|---|---|
| public SortedMultiset Implements com. Doc from com. Returns a view of this multiset restricted to the elements greater than The returned multiset will throw an
| |
descendingMultiset() will not reflect any changes you make to the behavior of methods such as
add(Object) or pollFirstEntry. This skeleton implementation correctly
delegates each of its operations to the appropriate methods of this ForwardingSortedMultiset.
In many cases, you may wish to override descendingMultiset() to return an instance
of a subclass of StandardDescendingMultiset.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv SortedMultiset |
| StandardDescendingMultiset | back to summary |
|---|---|
| public StandardDescendingMultiset() Constructor for use by subclasses. | |
| forwardMultiset | back to summary |
|---|---|
| pack-priv SortedMultiset Implements abstract com.
| |
SortedMultiset#elementSet in terms of the following
methods: SortedMultiset#clear, SortedMultiset#comparator, SortedMultiset#contains, SortedMultiset#containsAll, SortedMultiset#count,
SortedMultiset#firstEntry SortedMultiset#headMultiset, SortedMultiset#isEmpty, SortedMultiset#lastEntry, SortedMultiset#subMultiset,
SortedMultiset#tailMultiset, the size() and iterator() methods of
SortedMultiset#entrySet, and SortedMultiset#remove(Object, int). In many
situations, you may wish to override SortedMultiset#elementSet to forward to this
implementation or a subclass thereof.
| Access | Constructor and Description |
|---|---|
| public |
| StandardElementSet | back to summary |
|---|---|
| public StandardElementSet() Constructor for use by subclasses. | |