Lines Matching refs:multiset

57    * Returns an unmodifiable view of the specified multiset. Query operations on
58 * the returned multiset "read through" to the specified multiset, and
59 * attempts to modify the returned multiset result in an
62 * <p>The returned multiset will be serializable if the specified multiset is
65 * @param multiset the multiset for which an unmodifiable view is to be
67 * @return an unmodifiable view of the multiset
70 Multiset<? extends E> multiset) {
71 if (multiset instanceof UnmodifiableMultiset ||
72 multiset instanceof ImmutableMultiset) {
75 Multiset<E> result = (Multiset<E>) multiset;
78 return new UnmodifiableMultiset<E>(checkNotNull(multiset));
88 ImmutableMultiset<E> multiset) {
89 return checkNotNull(multiset);
180 * Returns an unmodifiable view of the specified sorted multiset. Query
181 * operations on the returned multiset "read through" to the specified
182 * multiset, and attempts to modify the returned multiset result in an {@link
185 * <p>The returned multiset will be serializable if the specified multiset is
188 * @param sortedMultiset the sorted multiset for which an unmodifiable view is
190 * @return an unmodifiable view of the multiset
283 * Returns an immutable multiset entry with the specified element and count.
319 * Returns a multiset view of the specified set. The multiset is backed by the
320 * set, so changes to the set are reflected in the multiset, and vice versa.
321 * If the set is modified while an iteration over the multiset is in progress
325 * <p>The multiset supports element removal, which removes the corresponding
330 * <p>The returned multiset will be serializable if the specified set is
331 * serializable. The multiset is threadsafe if the set is threadsafe.
333 * @param set the backing set for the returned multiset view
385 @Override Multiset<E> multiset() {
482 * An element's count in the multiset is the smaller of its counts in the two
483 * backing multisets. The iteration order of the returned multiset matches the
686 * Returns a string representation of this multiset entry. The string
702 static boolean equalsImpl(Multiset<?> multiset, @Nullable Object object) {
703 if (object == multiset) {
714 if (multiset.size() != that.size()
715 || multiset.entrySet().size() != that.entrySet().size()) {
719 if (multiset.count(entry.getElement()) != entry.getCount()) {
804 abstract Multiset<E> multiset();
807 multiset().clear();
811 return multiset().contains(o);
815 return multiset().containsAll(c);
819 return multiset().isEmpty();
823 return Iterators.transform(multiset().entrySet().iterator(),
833 int count = multiset().count(o);
835 multiset().remove(o, count);
842 return multiset().entrySet().size();
847 abstract Multiset<E> multiset();
856 int count = multiset().count(entry.getElement());
866 && multiset().elementSet().remove(((Entry<?>) o).getElement());
870 multiset().clear();
877 static <E> Iterator<E> iteratorImpl(Multiset<E> multiset) {
879 multiset, multiset.entrySet().iterator());
883 private final Multiset<E> multiset;
893 Multiset<E> multiset, Iterator<Entry<E>> entryIterator) {
894 this.multiset = multiset;
924 multiset.remove(currentEntry.getElement());
934 static int sizeImpl(Multiset<?> multiset) {
936 for (Entry<?> entry : multiset.entrySet()) {
961 * Returns a copy of {@code multiset} as an {@link ImmutableMultiset} whose iteration order is
962 * highest count first, with ties broken by the iteration order of the original multiset.
967 public static <E> ImmutableMultiset<E> copyHighestCountFirst(Multiset<E> multiset) {
969 Multisets.DECREASING_COUNT_ORDERING.sortedCopy(multiset.entrySet());