package com.google.common.collect; import com.google.common.collect.Multiset; import com.google.common.collect.Multisets; import com.google.errorprone.annotations.concurrent.LazyInit; import java.util.AbstractCollection; import java.util.Collection; import java.util.Iterator; import java.util.Set; import javax.annotation.CheckForNull; /* JADX INFO: Access modifiers changed from: package-private */ @ElementTypesAreNonnullByDefault /* loaded from: classes3.dex */ public abstract class AbstractMultiset extends AbstractCollection implements Multiset { @CheckForNull @LazyInit private transient Set elementSet; @CheckForNull @LazyInit 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(@CheckForNull Object obj) { return count(obj) > 0; } @Override // java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset public final boolean add(@ParametricNullness E e) { add(e, 1); return true; } public int add(@ParametricNullness E e, int i) { throw new UnsupportedOperationException(); } @Override // java.util.AbstractCollection, java.util.Collection, com.google.common.collect.Multiset public final boolean remove(@CheckForNull Object obj) { return remove(obj, 1) > 0; } public int remove(@CheckForNull Object obj, int i) { throw new UnsupportedOperationException(); } public int setCount(@ParametricNullness E e, int i) { return Multisets.setCountImpl(this, e, i); } public boolean setCount(@ParametricNullness 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(); } /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes3.dex */ public class ElementSet extends Multisets.ElementSet { @Override // com.google.common.collect.Multisets.ElementSet Multiset multiset() { return AbstractMultiset.this; } ElementSet() { } @Override // com.google.common.collect.Multisets.ElementSet, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set public Iterator iterator() { return AbstractMultiset.this.elementIterator(); } } @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: classes3.dex */ public class EntrySet extends Multisets.EntrySet { @Override // com.google.common.collect.Multisets.EntrySet Multiset multiset() { return AbstractMultiset.this; } /* JADX INFO: Access modifiers changed from: package-private */ public EntrySet() { } @Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set public Iterator> iterator() { return AbstractMultiset.this.entryIterator(); } @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set public int size() { return AbstractMultiset.this.distinctElements(); } } Set> createEntrySet() { return new EntrySet(); } @Override // java.util.Collection, com.google.common.collect.Multiset public final boolean equals(@CheckForNull 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(); } }