Home | History | Annotate | Download | only in collect

Lines Matching refs:multiset

35  * An immutable hash-based multiset. Does not permit null elements.
39 * multiset contains multiple instances of an element, those instances are
47 implements Multiset<E> {
50 * Returns the empty immutable multiset.
60 * Returns an immutable multiset containing the given elements.
62 * <p>The multiset is ordered by the first occurrence of each element. For
63 * example, {@code ImmutableMultiset.of(2, 3, 1, 3)} yields a multiset with
73 * Returns an immutable multiset containing the given elements.
75 * <p>The multiset is ordered by the first occurrence of each element. For
77 * a multiset with elements in the order {@code 2, 3, 3, 1}.
88 * the given multiset itself will be returned.
101 Multiset<? extends E> multiset = (elements instanceof Multiset)
102 ? (Multiset<? extends E>) elements
105 return copyOfInternal(multiset);
109 Multiset<? extends E> multiset) {
113 for (Entry<? extends E> entry : multiset.entrySet()) {
131 * Returns an immutable multiset containing the given elements.
133 * <p>The multiset is ordered by the first occurrence of each element. For
136 * yields a multiset with elements in the order {@code 2, 3, 3, 1}.
142 Multiset<E> multiset = LinkedHashMultiset.create();
143 Iterators.addAll(multiset, elements);
144 return copyOfInternal(multiset);
244 if (object instanceof Multiset) {
245 Multiset<?> that = (Multiset<?>) object;
268 // TODO: Serialization of the element set should serialize the multiset, and
269 // deserialization should call multiset.elementSet(). Then
270 // reserialized(multiset).elementSet() == reserialized(multiset.elementSet())
284 final ImmutableMultiset<E> multiset;
286 public EntrySet(ImmutableMultiset<E> multiset) {
287 this.multiset = multiset;
292 = multiset.map.entrySet().iterator();
306 return multiset.map.size();
315 int count = multiset.count(entry.getElement());
322 return multiset.map.hashCode();
378 * A builder for creating immutable multiset instances, especially
392 * multiple times to build multiple multisets in series. Each multiset
393 * is a superset of the multiset created before it.
396 private final Multiset<E> contents = LinkedHashMultiset.create();
439 * @param count the desired count of the element in this multiset
472 if (elements instanceof Multiset) {
474 Multiset<? extends E> multiset = (Multiset<? extends E>) elements;
475 for (Entry<? extends E> entry : multiset.entrySet()) {