Home | History | Annotate | Download | only in collect

Lines Matching refs:multiset

35  * Multiset} instances.
46 * Returns an unmodifiable view of the specified multiset. Query operations on
47 * the returned multiset "read through" to the specified multiset, and
48 * attempts to modify the returned multiset result in an
51 * <p>The returned multiset will be serializable if the specified multiset is
54 * @param multiset the multiset for which an unmodifiable view is to be
56 * @return an unmodifiable view of the multiset
58 public static <E> Multiset<E> unmodifiableMultiset(
59 Multiset<? extends E> multiset) {
60 return new UnmodifiableMultiset<E>(multiset);
65 final Multiset<? extends E> delegate;
67 UnmodifiableMultiset(Multiset<? extends E> delegate) {
72 @Override protected Multiset<E> delegate() {
74 return (Multiset) delegate;
86 transient Set<Multiset.Entry<E>> entrySet;
89 @Override public Set<Multiset.Entry<E>> entrySet() {
90 Set<Multiset.Entry<E>> es = entrySet;
148 * Returns an immutable multiset entry with the specified element and count.
154 public static <E> Multiset.Entry<E> immutableEntry(
168 * Returns a multiset view of the specified set. The multiset is backed by the
169 * set, so changes to the set are reflected in the multiset, and vice versa.
170 * If the set is modified while an iteration over the multiset is in progress
174 * <p>The multiset supports element removal, which removes the corresponding
179 * <p>The returned multiset will be serializable if the specified set is
180 * serializable. The multiset is threadsafe if the set is threadsafe.
182 * @param set the backing set for the returned multiset view
184 static <E> Multiset<E> forSet(Set<E> set) {
190 implements Multiset<E>, Serializable {
257 if (object instanceof Multiset) {
258 Multiset<?> that = (Multiset<?>) object;
316 * elements} is an instance of {@code Multiset}; otherwise the default value
320 if (elements instanceof Multiset) {
321 return ((Multiset<?>) elements).elementSet().size();
328 * An element's count in the multiset is the smaller of its counts in the two
329 * backing multisets. The iteration order of the returned multiset matches the
339 public static <E> Multiset<E> intersection(
340 final Multiset<E> multiset1, final Multiset<?> multiset2) {
401 * {@code toString} methods of {@link Multiset.Entry}.
403 abstract static class AbstractEntry<E> implements Multiset.Entry<E> {
406 * specified in {@link Multiset.Entry#equals}.
409 if (object instanceof Multiset.Entry) {
410 Multiset.Entry<?> that = (Multiset.Entry<?>) object;
419 * {@link Multiset.Entry#hashCode}.
427 * Returns a string representation of this multiset entry. The string
440 static <E> int setCountImpl(Multiset<E> self, E element, int count) {
456 Multiset<E> self, E element, int oldCount, int newCount) {