Comparator. In all cases, this implementation uses Comparable#compareTo or Comparator#compare instead of Object#equals to determine
equivalence of instances.Warning
The comparison must be consistent with equals as explained by the
Comparable class specification. Otherwise, the resulting multiset will violate the java. contract, which is specified in terms of Object#equals.
See the Guava User Guide article on Multiset.
| Modifier and Type | Class and Description |
|---|---|
| private static enum | TreeMultiset.Aggregate
A function which can be summed across a subtree. |
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final transient TreeMultiset. | |
| private final transient GeneralRange | |
| private final transient TreeMultiset. | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv | TreeMultiset(TreeMultiset.
|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | add(E
the element to add occurrences of; may be null only if explicitly allowed by the
implementation element, int the number of occurrences of the element to add. May be zero, in which case
no change will be made. occurrences)Overrides com. Implements com. |
| private long | |
| private long | |
| private long | |
| public void | clear()
Implements abstract com. Implements java. |
| public int | count(Object
the element to count occurrences of element)Implements com. |
| public static <E extends Comparable | |
| public static <E extends @Nullable Object> TreeMultiset | create(Comparator<? super E>
the comparator that will be used to sort this multiset. A null value
indicates that the elements' natural ordering should be used. comparator)Creates a new, empty multiset, sorted according to the specified comparator. |
| public static <E extends Comparable | |
| pack-priv Iterator | |
| pack-priv int | |
| pack-priv static int | |
| pack-priv Iterator | |
| pack-priv Iterator | |
| private TreeMultiset. | |
| public void | forEachEntry(ObjIntConsumer<? super E> action)
Overrides default com. |
| public SortedMultiset | headMultiset(E upperBound, BoundType boundType)
Implements com. upperBound,
optionally including upperBound itself.
|
| public Iterator | iterator()
Implements abstract java. Implements com. T.
|
| private TreeMultiset. | |
| private void | |
| public int | remove(Object
the element to conditionally remove occurrences of element, int the number of occurrences of the element to remove. May be zero, in which
case no change will be made. occurrences)Overrides com. Implements com. |
| public int | setCount(E
the element to add or remove occurrences of; may be null only if explicitly
allowed by the implementation element, int the desired count of the element in this multiset count)Overrides com. Implements com. |
| public boolean | setCount(E
the element to conditionally set the count of; may be null only if explicitly
allowed by the implementation element, int the expected present count of the element in this multiset oldCount, int the desired count of the element in this multiset newCount)Overrides com. Implements com. setCount(Object, int), provided that the element has the expected current count.
|
| public int | size()
Implements abstract java. Implements com. |
| private static <T extends @Nullable Object> void | |
| private static <T extends @Nullable Object> void | |
| public SortedMultiset | tailMultiset(E lowerBound, BoundType boundType)
Implements com. lowerBound,
optionally including lowerBound itself.
|
| private Multiset. | |
| private void |