package com.google.common.collect; import com.google.common.collect.Multiset; import com.google.common.collect.Multisets; import java.util.AbstractCollection; import java.util.Collection; import java.util.Iterator; import java.util.Set; /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes2.dex */ public abstract class AbstractMultiset extends AbstractCollection implements Multiset { private transient Set elementSet; private transient Set> entrySet; @Override // java.util.AbstractCollection, java.util.Collection public abstract void clear(); abstract int distinctElements(); abstract Iterator elementIterator(); /* JADX INFO: Access modifiers changed from: package-private */ public abstract Iterator> entryIterator(); @Override // java.util.AbstractCollection, java.util.Collection public boolean isEmpty() { return entrySet().isEmpty(); } @Override // java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset public boolean contains(Object obj) { return count(obj) > 0; } @Override // java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset public final boolean add(E e) { add(e, 1); return true; } public int add(E e, int i) { throw new UnsupportedOperationException(); } @Override // java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset public final boolean remove(Object obj) { return remove(obj, 1) > 0; } public int remove(Object obj, int i) { throw new UnsupportedOperationException(); } public int setCount(E e, int i) { return Multisets.setCountImpl(this, e, i); } public boolean setCount(E e, int i, int i2) { return Multisets.setCountImpl(this, e, i, i2); } @Override // java.util.AbstractCollection, java.util.Collection public final boolean addAll(Collection collection) { return Multisets.addAllImpl(this, collection); } @Override // java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset public final boolean removeAll(Collection collection) { return Multisets.removeAllImpl(this, collection); } @Override // java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset public final boolean retainAll(Collection collection) { return Multisets.retainAllImpl(this, collection); } @Override // com.google.common.collect.Multiset public Set elementSet() { Set set = this.elementSet; if (set != null) { return set; } Set createElementSet = createElementSet(); this.elementSet = createElementSet; return createElementSet; } Set createElementSet() { return new ElementSet(this); } /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes2.dex */ public class ElementSet extends Multisets.ElementSet { final AbstractMultiset this$0; ElementSet(AbstractMultiset abstractMultiset) { this.this$0 = abstractMultiset; } @Override // com.google.common.collect.Multisets.ElementSet, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set public Iterator iterator() { return this.this$0.elementIterator(); } @Override // com.google.common.collect.Multisets.ElementSet Multiset multiset() { return this.this$0; } } @Override // com.google.common.collect.Multiset public Set> entrySet() { Set> set = this.entrySet; if (set != null) { return set; } Set> createEntrySet = createEntrySet(); this.entrySet = createEntrySet; return createEntrySet; } /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes2.dex */ public class EntrySet extends Multisets.EntrySet { final AbstractMultiset this$0; /* JADX INFO: Access modifiers changed from: package-private */ public EntrySet(AbstractMultiset abstractMultiset) { this.this$0 = abstractMultiset; } @Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set public Iterator> iterator() { return this.this$0.entryIterator(); } @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set public int size() { return this.this$0.distinctElements(); } @Override // com.google.common.collect.Multisets.EntrySet Multiset multiset() { return this.this$0; } } Set> createEntrySet() { return new EntrySet(this); } @Override // java.util.Collection, com.google.common.collect.Multiset public final boolean equals(Object obj) { return Multisets.equalsImpl(this, obj); } @Override // java.util.Collection, com.google.common.collect.Multiset public final int hashCode() { return entrySet().hashCode(); } @Override // java.util.AbstractCollection, com.google.common.collect.Multiset public final String toString() { return entrySet().toString(); } }