final class DescendingImmutableSortedMultiset<E> extends ImmutableSortedMultiset<E>
ImmutableSortedMultiset
ImmutableSortedMultiset.Builder<E>
ImmutableMultiset.EntrySetSerializedForm<E>
ImmutableCollection.ArrayBasedBuilder<E>
Multiset.Entry<E>
Modifier and Type | Field and Description |
---|---|
private ImmutableSortedMultiset<E> |
forward |
descendingMultiset
Constructor and Description |
---|
DescendingImmutableSortedMultiset(ImmutableSortedMultiset<E> forward) |
Modifier and Type | Method and Description |
---|---|
int |
count(java.lang.Object element)
Returns the number of occurrences of an element in this multiset (the
count of the element).
|
ImmutableSortedMultiset<E> |
descendingMultiset()
Returns a descending view of this multiset.
|
ImmutableSortedSet<E> |
elementSet()
Returns a
NavigableSet view of the distinct elements in this multiset. |
Multiset.Entry<E> |
firstEntry()
Returns the entry of the first element in this multiset, or
null if
this multiset is empty. |
(package private) Multiset.Entry<E> |
getEntry(int index) |
ImmutableSortedMultiset<E> |
headMultiset(E upperBound,
BoundType boundType)
Returns a view of this multiset restricted to the elements less than
upperBound , optionally including upperBound itself. |
(package private) boolean |
isPartialView()
Returns
true if this immutable collection's implementation contains references to
user-created objects that aren't accessible via this collection's methods. |
Multiset.Entry<E> |
lastEntry()
Returns the entry of the last element in this multiset, or
null if
this multiset is empty. |
int |
size() |
ImmutableSortedMultiset<E> |
tailMultiset(E lowerBound,
BoundType boundType)
Returns a view of this multiset restricted to the elements greater than
lowerBound , optionally including lowerBound itself. |
comparator, copyOf, copyOf, copyOf, copyOf, copyOf, copyOfSorted, emptyMultiset, naturalOrder, of, of, of, of, of, of, of, orderedBy, pollFirstEntry, pollLastEntry, reverseOrder, subMultiset, writeReplace
builder
add, contains, containsAll, copyFromEntries, copyIntoArray, entrySet, equals, hashCode, iterator, remove, setCount, setCount, toString
add, addAll, asList, clear, createAsList, remove, removeAll, retainAll, toArray, toArray
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
entrySet, iterator
add, add, contains, containsAll, equals, hashCode, remove, remove, removeAll, retainAll, setCount, setCount, toString
private final transient ImmutableSortedMultiset<E> forward
DescendingImmutableSortedMultiset(ImmutableSortedMultiset<E> forward)
public int count(@Nullable java.lang.Object element)
Multiset
Object.equals(java.lang.Object)
-based
multiset, this gives the same result as Collections.frequency(java.util.Collection<?>, java.lang.Object)
(which would presumably perform more poorly).
Note: the utility method Iterables.frequency(java.lang.Iterable<?>, java.lang.Object)
generalizes
this operation; it correctly delegates to this method when dealing with a
multiset, but it can also accept any other iterable type.
element
- the element to count occurrences ofpublic Multiset.Entry<E> firstEntry()
SortedMultiset
null
if
this multiset is empty.public Multiset.Entry<E> lastEntry()
SortedMultiset
null
if
this multiset is empty.public int size()
public ImmutableSortedSet<E> elementSet()
SortedMultiset
NavigableSet
view of the distinct elements in this multiset.elementSet
in interface Multiset<E>
elementSet
in interface SortedMultiset<E>
elementSet
in interface SortedMultisetBridge<E>
elementSet
in class ImmutableSortedMultiset<E>
Multiset.Entry<E> getEntry(int index)
getEntry
in class ImmutableMultiset<E>
public ImmutableSortedMultiset<E> descendingMultiset()
SortedMultiset
descendingMultiset
in interface SortedMultiset<E>
descendingMultiset
in class ImmutableSortedMultiset<E>
public ImmutableSortedMultiset<E> headMultiset(E upperBound, BoundType boundType)
SortedMultiset
upperBound
, optionally including upperBound
itself. The
returned multiset is a view of this multiset, so changes to one will be
reflected in the other. The returned multiset supports all operations that
this multiset supports.
The returned multiset will throw an IllegalArgumentException
on
attempts to add elements outside its range.
headMultiset
in interface SortedMultiset<E>
headMultiset
in class ImmutableSortedMultiset<E>
public ImmutableSortedMultiset<E> tailMultiset(E lowerBound, BoundType boundType)
SortedMultiset
lowerBound
, optionally including lowerBound
itself. The
returned multiset is a view of this multiset, so changes to one will be
reflected in the other. The returned multiset supports all operations that
this multiset supports.
The returned multiset will throw an IllegalArgumentException
on
attempts to add elements outside its range.
tailMultiset
in interface SortedMultiset<E>
tailMultiset
in class ImmutableSortedMultiset<E>
boolean isPartialView()
ImmutableCollection
true
if this immutable collection's implementation contains references to
user-created objects that aren't accessible via this collection's methods. This is generally
used to determine whether copyOf
implementations should make an explicit copy to avoid
memory leaks.isPartialView
in class ImmutableCollection<E>