what-the-bank/sources/com/google/common/collect/TreeMultimap.java

217 lines
10 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.google.common.collect;
import com.google.common.base.Preconditions;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Collection;
import java.util.Comparator;
import java.util.Map;
import java.util.NavigableMap;
import java.util.NavigableSet;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;
/* loaded from: classes2.dex */
public class TreeMultimap<K, V> extends AbstractSortedKeySortedSetMultimap<K, V> {
private static final long serialVersionUID = 0;
private transient Comparator<? super K> keyComparator;
private transient Comparator<? super V> valueComparator;
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
public /* bridge */ /* synthetic */ void clear() {
super.clear();
}
@Override // com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
public /* bridge */ /* synthetic */ boolean containsEntry(Object obj, Object obj2) {
return super.containsEntry(obj, obj2);
}
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
public /* bridge */ /* synthetic */ boolean containsKey(Object obj) {
return super.containsKey(obj);
}
@Override // com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
public /* bridge */ /* synthetic */ boolean containsValue(Object obj) {
return super.containsValue(obj);
}
@Override // com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
public /* bridge */ /* synthetic */ Set entries() {
return super.entries();
}
@Override // com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap, com.google.common.collect.ListMultimap
public /* bridge */ /* synthetic */ boolean equals(Object obj) {
return super.equals(obj);
}
/* JADX WARN: Multi-variable type inference failed */
@Override // com.google.common.collect.AbstractSortedSetMultimap, com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
public /* bridge */ /* synthetic */ Collection get(Object obj) {
return get((TreeMultimap<K, V>) obj);
}
/* JADX WARN: Multi-variable type inference failed */
@Override // com.google.common.collect.AbstractSortedSetMultimap, com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
public /* bridge */ /* synthetic */ Set get(Object obj) {
return get((TreeMultimap<K, V>) obj);
}
/* JADX WARN: Multi-variable type inference failed */
@Override // com.google.common.collect.AbstractSortedSetMultimap, com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
public /* bridge */ /* synthetic */ SortedSet get(Object obj) {
return get((TreeMultimap<K, V>) obj);
}
@Override // com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
public /* bridge */ /* synthetic */ int hashCode() {
return super.hashCode();
}
@Override // com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
public /* bridge */ /* synthetic */ boolean isEmpty() {
return super.isEmpty();
}
@Override // com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
public /* bridge */ /* synthetic */ Multiset keys() {
return super.keys();
}
/* JADX WARN: Multi-variable type inference failed */
@Override // com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
public /* bridge */ /* synthetic */ boolean put(Object obj, Object obj2) {
return super.put(obj, obj2);
}
@Override // com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
public /* bridge */ /* synthetic */ boolean putAll(Multimap multimap) {
return super.putAll(multimap);
}
/* JADX WARN: Multi-variable type inference failed */
@Override // com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
public /* bridge */ /* synthetic */ boolean putAll(Object obj, Iterable iterable) {
return super.putAll(obj, iterable);
}
@Override // com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
public /* bridge */ /* synthetic */ boolean remove(Object obj, Object obj2) {
return super.remove(obj, obj2);
}
@Override // com.google.common.collect.AbstractSortedSetMultimap, com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
public /* bridge */ /* synthetic */ SortedSet removeAll(Object obj) {
return super.removeAll(obj);
}
@Override // com.google.common.collect.AbstractSortedSetMultimap, com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
public /* bridge */ /* synthetic */ SortedSet replaceValues(Object obj, Iterable iterable) {
return super.replaceValues(obj, iterable);
}
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
public /* bridge */ /* synthetic */ int size() {
return super.size();
}
@Override // com.google.common.collect.AbstractMultimap
public /* bridge */ /* synthetic */ String toString() {
return super.toString();
}
@Override // com.google.common.collect.AbstractSortedSetMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
public /* bridge */ /* synthetic */ Collection values() {
return super.values();
}
public static <K extends Comparable, V extends Comparable> TreeMultimap<K, V> create() {
return new TreeMultimap<>(Ordering.natural(), Ordering.natural());
}
public static <K, V> TreeMultimap<K, V> create(Comparator<? super K> comparator, Comparator<? super V> comparator2) {
return new TreeMultimap<>((Comparator) Preconditions.checkNotNull(comparator), (Comparator) Preconditions.checkNotNull(comparator2));
}
public static <K extends Comparable, V extends Comparable> TreeMultimap<K, V> create(Multimap<? extends K, ? extends V> multimap) {
return new TreeMultimap<>(Ordering.natural(), Ordering.natural(), multimap);
}
TreeMultimap(Comparator<? super K> comparator, Comparator<? super V> comparator2) {
super(new TreeMap(comparator));
this.keyComparator = comparator;
this.valueComparator = comparator2;
}
private TreeMultimap(Comparator<? super K> comparator, Comparator<? super V> comparator2, Multimap<? extends K, ? extends V> multimap) {
this(comparator, comparator2);
putAll(multimap);
}
@Override // com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.AbstractMultimap
Map<K, Collection<V>> createAsMap() {
return createMaybeNavigableAsMap();
}
/* JADX INFO: Access modifiers changed from: package-private */
@Override // com.google.common.collect.AbstractSortedSetMultimap, com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap
public SortedSet<V> createCollection() {
return new TreeSet(this.valueComparator);
}
/* JADX INFO: Access modifiers changed from: package-private */
/* JADX WARN: Multi-variable type inference failed */
@Override // com.google.common.collect.AbstractMapBasedMultimap
public Collection<V> createCollection(K k) {
if (k == 0) {
keyComparator().compare(k, k);
}
return super.createCollection(k);
}
@Override // com.google.common.collect.AbstractSortedSetMultimap, com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMapBasedMultimap, com.google.common.collect.Multimap
public NavigableSet<V> get(K k) {
return (NavigableSet) super.get((Object) k);
}
@Override // com.google.common.collect.AbstractSortedKeySortedSetMultimap, com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap
public NavigableSet<K> keySet() {
return (NavigableSet) super.keySet();
}
@Override // com.google.common.collect.AbstractSortedKeySortedSetMultimap, com.google.common.collect.AbstractSortedSetMultimap, com.google.common.collect.AbstractSetMultimap, com.google.common.collect.AbstractMultimap, com.google.common.collect.Multimap, com.google.common.collect.ListMultimap
public NavigableMap<K, Collection<V>> asMap() {
return (NavigableMap) super.asMap();
}
private void writeObject(ObjectOutputStream objectOutputStream) throws IOException {
objectOutputStream.defaultWriteObject();
objectOutputStream.writeObject(keyComparator());
objectOutputStream.writeObject(valueComparator());
Serialization.writeMultimap(this, objectOutputStream);
}
private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException {
objectInputStream.defaultReadObject();
this.keyComparator = (Comparator) Preconditions.checkNotNull((Comparator) objectInputStream.readObject());
this.valueComparator = (Comparator) Preconditions.checkNotNull((Comparator) objectInputStream.readObject());
setMap(new TreeMap(this.keyComparator));
Serialization.populateMultimap(this, objectInputStream);
}
@Override // com.google.common.collect.SortedSetMultimap
public Comparator<? super V> valueComparator() {
return this.valueComparator;
}
@Deprecated
public Comparator<? super K> keyComparator() {
return this.keyComparator;
}
}