1241 lines
36 KiB
Java
1241 lines
36 KiB
Java
package ra;
|
|
|
|
import java.io.Serializable;
|
|
import java.util.AbstractCollection;
|
|
import java.util.Collection;
|
|
import java.util.Comparator;
|
|
import java.util.ConcurrentModificationException;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.ListIterator;
|
|
import java.util.Map;
|
|
import java.util.NavigableMap;
|
|
import java.util.NavigableSet;
|
|
import java.util.RandomAccess;
|
|
import java.util.Set;
|
|
import java.util.SortedMap;
|
|
import java.util.SortedSet;
|
|
import ra.c0;
|
|
import ra.f;
|
|
/* compiled from: AbstractMapBasedMultimap.java */
|
|
/* loaded from: classes4.dex */
|
|
abstract class d<K, V> extends f<K, V> implements Serializable {
|
|
|
|
/* renamed from: n reason: collision with root package name */
|
|
private transient Map<K, Collection<V>> f21654n;
|
|
|
|
/* renamed from: o reason: collision with root package name */
|
|
private transient int f21655o;
|
|
|
|
/* compiled from: AbstractMapBasedMultimap.java */
|
|
/* loaded from: classes4.dex */
|
|
class a extends d<K, V>.AbstractC0377d<V> {
|
|
a() {
|
|
super();
|
|
}
|
|
|
|
@Override // ra.d.AbstractC0377d
|
|
V b(K k2, V v10) {
|
|
return v10;
|
|
}
|
|
}
|
|
|
|
/* compiled from: AbstractMapBasedMultimap.java */
|
|
/* loaded from: classes4.dex */
|
|
class b extends d<K, V>.AbstractC0377d<Map.Entry<K, V>> {
|
|
b() {
|
|
super();
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* renamed from: c */
|
|
public Map.Entry<K, V> b(K k2, V v10) {
|
|
return c0.c(k2, v10);
|
|
}
|
|
}
|
|
|
|
/* compiled from: AbstractMapBasedMultimap.java */
|
|
/* loaded from: classes4.dex */
|
|
private class c extends c0.f<K, Collection<V>> {
|
|
|
|
/* renamed from: l reason: collision with root package name */
|
|
final transient Map<K, Collection<V>> f21658l;
|
|
|
|
/* compiled from: AbstractMapBasedMultimap.java */
|
|
/* loaded from: classes4.dex */
|
|
class a extends c0.c<K, Collection<V>> {
|
|
a() {
|
|
}
|
|
|
|
@Override // ra.c0.c
|
|
Map<K, Collection<V>> a() {
|
|
return c.this;
|
|
}
|
|
|
|
@Override // ra.c0.c, java.util.AbstractCollection, java.util.Collection, java.util.Set
|
|
public boolean contains(Object obj) {
|
|
return j.b(c.this.f21658l.entrySet(), obj);
|
|
}
|
|
|
|
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set
|
|
public Iterator<Map.Entry<K, Collection<V>>> iterator() {
|
|
return new b();
|
|
}
|
|
|
|
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
|
public boolean remove(Object obj) {
|
|
if (!contains(obj)) {
|
|
return false;
|
|
}
|
|
d.q(d.this, ((Map.Entry) obj).getKey());
|
|
return true;
|
|
}
|
|
}
|
|
|
|
/* compiled from: AbstractMapBasedMultimap.java */
|
|
/* loaded from: classes4.dex */
|
|
class b implements Iterator<Map.Entry<K, Collection<V>>> {
|
|
|
|
/* renamed from: j reason: collision with root package name */
|
|
final Iterator<Map.Entry<K, Collection<V>>> f21661j;
|
|
|
|
/* renamed from: k reason: collision with root package name */
|
|
Collection<V> f21662k;
|
|
|
|
b() {
|
|
this.f21661j = c.this.f21658l.entrySet().iterator();
|
|
}
|
|
|
|
/* renamed from: b */
|
|
public Map.Entry<K, Collection<V>> next() {
|
|
Map.Entry<K, Collection<V>> next = this.f21661j.next();
|
|
this.f21662k = next.getValue();
|
|
return c.this.e(next);
|
|
}
|
|
|
|
@Override // java.util.Iterator
|
|
public boolean hasNext() {
|
|
return this.f21661j.hasNext();
|
|
}
|
|
|
|
@Override // java.util.Iterator
|
|
public void remove() {
|
|
i.c(this.f21662k != null);
|
|
this.f21661j.remove();
|
|
d dVar = d.this;
|
|
d.n(dVar, d.m(dVar) - this.f21662k.size());
|
|
this.f21662k.clear();
|
|
this.f21662k = null;
|
|
}
|
|
}
|
|
|
|
c(Map<K, Collection<V>> map) {
|
|
this.f21658l = map;
|
|
}
|
|
|
|
@Override // ra.c0.f
|
|
protected Set<Map.Entry<K, Collection<V>>> a() {
|
|
return new a();
|
|
}
|
|
|
|
/* renamed from: c */
|
|
public Collection<V> get(Object obj) {
|
|
Collection<V> collection = (Collection) c0.g(this.f21658l, obj);
|
|
if (collection == null) {
|
|
return null;
|
|
}
|
|
return d.this.y(obj, collection);
|
|
}
|
|
|
|
@Override // java.util.AbstractMap, java.util.Map
|
|
public void clear() {
|
|
if (this.f21658l == d.k(d.this)) {
|
|
d.this.clear();
|
|
} else {
|
|
y.b(new b());
|
|
}
|
|
}
|
|
|
|
@Override // java.util.AbstractMap, java.util.Map
|
|
public boolean containsKey(Object obj) {
|
|
return c0.f(this.f21658l, obj);
|
|
}
|
|
|
|
/* renamed from: d */
|
|
public Collection<V> remove(Object obj) {
|
|
Collection<V> remove = this.f21658l.remove(obj);
|
|
if (remove == null) {
|
|
return null;
|
|
}
|
|
Collection<V> r10 = d.this.r();
|
|
r10.addAll(remove);
|
|
d dVar = d.this;
|
|
d.n(dVar, d.m(dVar) - remove.size());
|
|
remove.clear();
|
|
return r10;
|
|
}
|
|
|
|
Map.Entry<K, Collection<V>> e(Map.Entry<K, Collection<V>> entry) {
|
|
K key = entry.getKey();
|
|
return c0.c(key, d.this.y(key, entry.getValue()));
|
|
}
|
|
|
|
@Override // java.util.AbstractMap, java.util.Map
|
|
public boolean equals(Object obj) {
|
|
return this == obj || this.f21658l.equals(obj);
|
|
}
|
|
|
|
@Override // java.util.AbstractMap, java.util.Map
|
|
public int hashCode() {
|
|
return this.f21658l.hashCode();
|
|
}
|
|
|
|
@Override // java.util.AbstractMap, java.util.Map
|
|
public Set<K> keySet() {
|
|
return d.this.i();
|
|
}
|
|
|
|
@Override // java.util.AbstractMap, java.util.Map
|
|
public int size() {
|
|
return this.f21658l.size();
|
|
}
|
|
|
|
@Override // java.util.AbstractMap
|
|
public String toString() {
|
|
return this.f21658l.toString();
|
|
}
|
|
}
|
|
|
|
/* compiled from: AbstractMapBasedMultimap.java */
|
|
/* renamed from: ra.d$d reason: collision with other inner class name */
|
|
/* loaded from: classes4.dex */
|
|
private abstract class AbstractC0377d<T> implements Iterator<T> {
|
|
|
|
/* renamed from: j reason: collision with root package name */
|
|
final Iterator<Map.Entry<K, Collection<V>>> f21664j;
|
|
|
|
/* renamed from: k reason: collision with root package name */
|
|
K f21665k = null;
|
|
|
|
/* renamed from: l reason: collision with root package name */
|
|
Collection<V> f21666l = null;
|
|
|
|
/* renamed from: m reason: collision with root package name */
|
|
Iterator<V> f21667m = y.f();
|
|
|
|
AbstractC0377d() {
|
|
this.f21664j = (Iterator<Map.Entry<K, V>>) d.k(d.this).entrySet().iterator();
|
|
}
|
|
|
|
abstract T b(K k2, V v10);
|
|
|
|
@Override // java.util.Iterator
|
|
public boolean hasNext() {
|
|
return this.f21664j.hasNext() || this.f21667m.hasNext();
|
|
}
|
|
|
|
@Override // java.util.Iterator
|
|
public T next() {
|
|
if (!this.f21667m.hasNext()) {
|
|
Map.Entry<K, Collection<V>> next = this.f21664j.next();
|
|
this.f21665k = next.getKey();
|
|
Collection<V> value = next.getValue();
|
|
this.f21666l = value;
|
|
this.f21667m = value.iterator();
|
|
}
|
|
return b(this.f21665k, this.f21667m.next());
|
|
}
|
|
|
|
@Override // java.util.Iterator
|
|
public void remove() {
|
|
this.f21667m.remove();
|
|
if (this.f21666l.isEmpty()) {
|
|
this.f21664j.remove();
|
|
}
|
|
d.p(d.this);
|
|
}
|
|
}
|
|
|
|
/* compiled from: AbstractMapBasedMultimap.java */
|
|
/* loaded from: classes4.dex */
|
|
private class e extends c0.d<K, Collection<V>> {
|
|
|
|
/* compiled from: AbstractMapBasedMultimap.java */
|
|
/* loaded from: classes4.dex */
|
|
class a implements Iterator<K> {
|
|
|
|
/* renamed from: j reason: collision with root package name */
|
|
Map.Entry<K, Collection<V>> f21670j;
|
|
|
|
/* renamed from: k reason: collision with root package name */
|
|
final /* synthetic */ Iterator f21671k;
|
|
|
|
a(Iterator it) {
|
|
this.f21671k = it;
|
|
}
|
|
|
|
@Override // java.util.Iterator
|
|
public boolean hasNext() {
|
|
return this.f21671k.hasNext();
|
|
}
|
|
|
|
@Override // java.util.Iterator
|
|
public K next() {
|
|
Map.Entry<K, Collection<V>> entry = (Map.Entry) this.f21671k.next();
|
|
this.f21670j = entry;
|
|
return entry.getKey();
|
|
}
|
|
|
|
@Override // java.util.Iterator
|
|
public void remove() {
|
|
i.c(this.f21670j != null);
|
|
Collection<V> value = this.f21670j.getValue();
|
|
this.f21671k.remove();
|
|
d dVar = d.this;
|
|
d.n(dVar, d.m(dVar) - value.size());
|
|
value.clear();
|
|
this.f21670j = null;
|
|
}
|
|
}
|
|
|
|
e(Map<K, Collection<V>> map) {
|
|
super(map);
|
|
}
|
|
|
|
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
|
public void clear() {
|
|
y.b(iterator());
|
|
}
|
|
|
|
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
|
public boolean containsAll(Collection<?> collection) {
|
|
return a().keySet().containsAll(collection);
|
|
}
|
|
|
|
@Override // java.util.AbstractSet, java.util.Collection, java.util.Set
|
|
public boolean equals(Object obj) {
|
|
return this == obj || a().keySet().equals(obj);
|
|
}
|
|
|
|
@Override // java.util.AbstractSet, java.util.Collection, java.util.Set
|
|
public int hashCode() {
|
|
return a().keySet().hashCode();
|
|
}
|
|
|
|
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set
|
|
public Iterator<K> iterator() {
|
|
return new a(a().entrySet().iterator());
|
|
}
|
|
|
|
@Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
|
|
public boolean remove(Object obj) {
|
|
int i10;
|
|
Collection<V> remove = a().remove(obj);
|
|
if (remove != null) {
|
|
i10 = remove.size();
|
|
remove.clear();
|
|
d dVar = d.this;
|
|
d.n(dVar, d.m(dVar) - i10);
|
|
} else {
|
|
i10 = 0;
|
|
}
|
|
return i10 > 0;
|
|
}
|
|
}
|
|
|
|
/* compiled from: AbstractMapBasedMultimap.java */
|
|
/* loaded from: classes4.dex */
|
|
class f extends d<K, V>.i implements NavigableMap<K, Collection<V>> {
|
|
f(NavigableMap<K, Collection<V>> navigableMap) {
|
|
super(navigableMap);
|
|
}
|
|
|
|
@Override // java.util.NavigableMap
|
|
public Map.Entry<K, Collection<V>> ceilingEntry(K k2) {
|
|
Map.Entry<K, Collection<V>> ceilingEntry = i().ceilingEntry(k2);
|
|
if (ceilingEntry == null) {
|
|
return null;
|
|
}
|
|
return e(ceilingEntry);
|
|
}
|
|
|
|
@Override // java.util.NavigableMap
|
|
public K ceilingKey(K k2) {
|
|
return i().ceilingKey(k2);
|
|
}
|
|
|
|
@Override // java.util.NavigableMap
|
|
public NavigableSet<K> descendingKeySet() {
|
|
return descendingMap().navigableKeySet();
|
|
}
|
|
|
|
@Override // java.util.NavigableMap
|
|
public NavigableMap<K, Collection<V>> descendingMap() {
|
|
return new f(i().descendingMap());
|
|
}
|
|
|
|
@Override // java.util.NavigableMap
|
|
public Map.Entry<K, Collection<V>> firstEntry() {
|
|
Map.Entry<K, Collection<V>> firstEntry = i().firstEntry();
|
|
if (firstEntry == null) {
|
|
return null;
|
|
}
|
|
return e(firstEntry);
|
|
}
|
|
|
|
@Override // java.util.NavigableMap
|
|
public Map.Entry<K, Collection<V>> floorEntry(K k2) {
|
|
Map.Entry<K, Collection<V>> floorEntry = i().floorEntry(k2);
|
|
if (floorEntry == null) {
|
|
return null;
|
|
}
|
|
return e(floorEntry);
|
|
}
|
|
|
|
@Override // java.util.NavigableMap
|
|
public K floorKey(K k2) {
|
|
return i().floorKey(k2);
|
|
}
|
|
|
|
@Override // java.util.NavigableMap
|
|
public NavigableMap<K, Collection<V>> headMap(K k2, boolean z10) {
|
|
return new f(i().headMap(k2, z10));
|
|
}
|
|
|
|
@Override // java.util.NavigableMap
|
|
public Map.Entry<K, Collection<V>> higherEntry(K k2) {
|
|
Map.Entry<K, Collection<V>> higherEntry = i().higherEntry(k2);
|
|
if (higherEntry == null) {
|
|
return null;
|
|
}
|
|
return e(higherEntry);
|
|
}
|
|
|
|
@Override // java.util.NavigableMap
|
|
public K higherKey(K k2) {
|
|
return i().higherKey(k2);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* renamed from: j */
|
|
public NavigableSet<K> f() {
|
|
return new g(i());
|
|
}
|
|
|
|
/* renamed from: k */
|
|
public NavigableMap<K, Collection<V>> headMap(K k2) {
|
|
return headMap(k2, false);
|
|
}
|
|
|
|
/* renamed from: l */
|
|
public NavigableSet<K> keySet() {
|
|
return (NavigableSet) super.keySet();
|
|
}
|
|
|
|
@Override // java.util.NavigableMap
|
|
public Map.Entry<K, Collection<V>> lastEntry() {
|
|
Map.Entry<K, Collection<V>> lastEntry = i().lastEntry();
|
|
if (lastEntry == null) {
|
|
return null;
|
|
}
|
|
return e(lastEntry);
|
|
}
|
|
|
|
@Override // java.util.NavigableMap
|
|
public Map.Entry<K, Collection<V>> lowerEntry(K k2) {
|
|
Map.Entry<K, Collection<V>> lowerEntry = i().lowerEntry(k2);
|
|
if (lowerEntry == null) {
|
|
return null;
|
|
}
|
|
return e(lowerEntry);
|
|
}
|
|
|
|
@Override // java.util.NavigableMap
|
|
public K lowerKey(K k2) {
|
|
return i().lowerKey(k2);
|
|
}
|
|
|
|
Map.Entry<K, Collection<V>> m(Iterator<Map.Entry<K, Collection<V>>> it) {
|
|
if (!it.hasNext()) {
|
|
return null;
|
|
}
|
|
Map.Entry<K, Collection<V>> next = it.next();
|
|
Collection<V> r10 = d.this.r();
|
|
r10.addAll(next.getValue());
|
|
it.remove();
|
|
return c0.c(next.getKey(), d.this.x(r10));
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* renamed from: n */
|
|
public NavigableMap<K, Collection<V>> i() {
|
|
return (NavigableMap) super.i();
|
|
}
|
|
|
|
@Override // java.util.NavigableMap
|
|
public NavigableSet<K> navigableKeySet() {
|
|
return keySet();
|
|
}
|
|
|
|
/* renamed from: o */
|
|
public NavigableMap<K, Collection<V>> subMap(K k2, K k10) {
|
|
return subMap(k2, true, k10, false);
|
|
}
|
|
|
|
/* renamed from: p */
|
|
public NavigableMap<K, Collection<V>> tailMap(K k2) {
|
|
return tailMap(k2, true);
|
|
}
|
|
|
|
@Override // java.util.NavigableMap
|
|
public Map.Entry<K, Collection<V>> pollFirstEntry() {
|
|
return m(entrySet().iterator());
|
|
}
|
|
|
|
@Override // java.util.NavigableMap
|
|
public Map.Entry<K, Collection<V>> pollLastEntry() {
|
|
return m(descendingMap().entrySet().iterator());
|
|
}
|
|
|
|
@Override // java.util.NavigableMap
|
|
public NavigableMap<K, Collection<V>> subMap(K k2, boolean z10, K k10, boolean z11) {
|
|
return new f(i().subMap(k2, z10, k10, z11));
|
|
}
|
|
|
|
@Override // java.util.NavigableMap
|
|
public NavigableMap<K, Collection<V>> tailMap(K k2, boolean z10) {
|
|
return new f(i().tailMap(k2, z10));
|
|
}
|
|
}
|
|
|
|
/* compiled from: AbstractMapBasedMultimap.java */
|
|
/* loaded from: classes4.dex */
|
|
class g extends d<K, V>.j implements NavigableSet<K> {
|
|
g(NavigableMap<K, Collection<V>> navigableMap) {
|
|
super(navigableMap);
|
|
}
|
|
|
|
@Override // java.util.NavigableSet
|
|
public K ceiling(K k2) {
|
|
return c().ceilingKey(k2);
|
|
}
|
|
|
|
/* renamed from: d */
|
|
public NavigableSet<K> headSet(K k2) {
|
|
return headSet(k2, false);
|
|
}
|
|
|
|
@Override // java.util.NavigableSet
|
|
public Iterator<K> descendingIterator() {
|
|
return descendingSet().iterator();
|
|
}
|
|
|
|
@Override // java.util.NavigableSet
|
|
public NavigableSet<K> descendingSet() {
|
|
return new g(c().descendingMap());
|
|
}
|
|
|
|
@Override // java.util.NavigableSet
|
|
public K floor(K k2) {
|
|
return c().floorKey(k2);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* renamed from: g */
|
|
public NavigableMap<K, Collection<V>> c() {
|
|
return (NavigableMap) super.c();
|
|
}
|
|
|
|
/* renamed from: h */
|
|
public NavigableSet<K> subSet(K k2, K k10) {
|
|
return subSet(k2, true, k10, false);
|
|
}
|
|
|
|
@Override // java.util.NavigableSet
|
|
public NavigableSet<K> headSet(K k2, boolean z10) {
|
|
return new g(c().headMap(k2, z10));
|
|
}
|
|
|
|
@Override // java.util.NavigableSet
|
|
public K higher(K k2) {
|
|
return c().higherKey(k2);
|
|
}
|
|
|
|
/* renamed from: i */
|
|
public NavigableSet<K> tailSet(K k2) {
|
|
return tailSet(k2, true);
|
|
}
|
|
|
|
@Override // java.util.NavigableSet
|
|
public K lower(K k2) {
|
|
return c().lowerKey(k2);
|
|
}
|
|
|
|
@Override // java.util.NavigableSet
|
|
public K pollFirst() {
|
|
return (K) y.i(iterator());
|
|
}
|
|
|
|
@Override // java.util.NavigableSet
|
|
public K pollLast() {
|
|
return (K) y.i(descendingIterator());
|
|
}
|
|
|
|
@Override // java.util.NavigableSet
|
|
public NavigableSet<K> subSet(K k2, boolean z10, K k10, boolean z11) {
|
|
return new g(c().subMap(k2, z10, k10, z11));
|
|
}
|
|
|
|
@Override // java.util.NavigableSet
|
|
public NavigableSet<K> tailSet(K k2, boolean z10) {
|
|
return new g(c().tailMap(k2, z10));
|
|
}
|
|
}
|
|
|
|
/* compiled from: AbstractMapBasedMultimap.java */
|
|
/* loaded from: classes4.dex */
|
|
private class h extends d<K, V>.l implements RandomAccess {
|
|
h(K k2, List<V> list, d<K, V>.k kVar) {
|
|
super(k2, list, kVar);
|
|
}
|
|
}
|
|
|
|
/* compiled from: AbstractMapBasedMultimap.java */
|
|
/* loaded from: classes4.dex */
|
|
private class i extends d<K, V>.c implements SortedMap<K, Collection<V>> {
|
|
|
|
/* renamed from: n reason: collision with root package name */
|
|
SortedSet<K> f21676n;
|
|
|
|
i(SortedMap<K, Collection<V>> sortedMap) {
|
|
super(sortedMap);
|
|
}
|
|
|
|
@Override // java.util.SortedMap
|
|
public Comparator<? super K> comparator() {
|
|
return i().comparator();
|
|
}
|
|
|
|
SortedSet<K> f() {
|
|
return new j(i());
|
|
}
|
|
|
|
@Override // java.util.SortedMap
|
|
public K firstKey() {
|
|
return i().firstKey();
|
|
}
|
|
|
|
/* renamed from: h */
|
|
public SortedSet<K> keySet() {
|
|
SortedSet<K> sortedSet = this.f21676n;
|
|
if (sortedSet != null) {
|
|
return sortedSet;
|
|
}
|
|
SortedSet<K> f2 = f();
|
|
this.f21676n = f2;
|
|
return f2;
|
|
}
|
|
|
|
public SortedMap<K, Collection<V>> headMap(K k2) {
|
|
return new i(i().headMap(k2));
|
|
}
|
|
|
|
SortedMap<K, Collection<V>> i() {
|
|
return (SortedMap) this.f21658l;
|
|
}
|
|
|
|
@Override // java.util.SortedMap
|
|
public K lastKey() {
|
|
return i().lastKey();
|
|
}
|
|
|
|
public SortedMap<K, Collection<V>> subMap(K k2, K k10) {
|
|
return new i(i().subMap(k2, k10));
|
|
}
|
|
|
|
public SortedMap<K, Collection<V>> tailMap(K k2) {
|
|
return new i(i().tailMap(k2));
|
|
}
|
|
}
|
|
|
|
/* compiled from: AbstractMapBasedMultimap.java */
|
|
/* loaded from: classes4.dex */
|
|
private class j extends d<K, V>.e implements SortedSet<K> {
|
|
j(SortedMap<K, Collection<V>> sortedMap) {
|
|
super(sortedMap);
|
|
}
|
|
|
|
SortedMap<K, Collection<V>> c() {
|
|
return (SortedMap) super.a();
|
|
}
|
|
|
|
@Override // java.util.SortedSet
|
|
public Comparator<? super K> comparator() {
|
|
return c().comparator();
|
|
}
|
|
|
|
@Override // java.util.SortedSet
|
|
public K first() {
|
|
return c().firstKey();
|
|
}
|
|
|
|
public SortedSet<K> headSet(K k2) {
|
|
return new j(c().headMap(k2));
|
|
}
|
|
|
|
@Override // java.util.SortedSet
|
|
public K last() {
|
|
return c().lastKey();
|
|
}
|
|
|
|
public SortedSet<K> subSet(K k2, K k10) {
|
|
return new j(c().subMap(k2, k10));
|
|
}
|
|
|
|
public SortedSet<K> tailSet(K k2) {
|
|
return new j(c().tailMap(k2));
|
|
}
|
|
}
|
|
|
|
/* compiled from: AbstractMapBasedMultimap.java */
|
|
/* loaded from: classes4.dex */
|
|
class k extends AbstractCollection<V> {
|
|
|
|
/* renamed from: j reason: collision with root package name */
|
|
final K f21679j;
|
|
|
|
/* renamed from: k reason: collision with root package name */
|
|
Collection<V> f21680k;
|
|
|
|
/* renamed from: l reason: collision with root package name */
|
|
final d<K, V>.k f21681l;
|
|
|
|
/* renamed from: m reason: collision with root package name */
|
|
final Collection<V> f21682m;
|
|
|
|
/* compiled from: AbstractMapBasedMultimap.java */
|
|
/* loaded from: classes4.dex */
|
|
class a implements Iterator<V> {
|
|
|
|
/* renamed from: j reason: collision with root package name */
|
|
final Iterator<V> f21684j;
|
|
|
|
/* renamed from: k reason: collision with root package name */
|
|
final Collection<V> f21685k;
|
|
|
|
a() {
|
|
Collection<V> collection = k.this.f21680k;
|
|
this.f21685k = collection;
|
|
this.f21684j = d.l(collection);
|
|
}
|
|
|
|
a(Iterator<V> it) {
|
|
this.f21685k = k.this.f21680k;
|
|
this.f21684j = it;
|
|
}
|
|
|
|
Iterator<V> b() {
|
|
c();
|
|
return this.f21684j;
|
|
}
|
|
|
|
void c() {
|
|
k.this.h();
|
|
if (k.this.f21680k != this.f21685k) {
|
|
throw new ConcurrentModificationException();
|
|
}
|
|
}
|
|
|
|
@Override // java.util.Iterator
|
|
public boolean hasNext() {
|
|
c();
|
|
return this.f21684j.hasNext();
|
|
}
|
|
|
|
@Override // java.util.Iterator
|
|
public V next() {
|
|
c();
|
|
return this.f21684j.next();
|
|
}
|
|
|
|
@Override // java.util.Iterator
|
|
public void remove() {
|
|
this.f21684j.remove();
|
|
d.p(d.this);
|
|
k.this.i();
|
|
}
|
|
}
|
|
|
|
k(K k2, Collection<V> collection, d<K, V>.k kVar) {
|
|
this.f21679j = k2;
|
|
this.f21680k = collection;
|
|
this.f21681l = kVar;
|
|
this.f21682m = kVar == null ? null : kVar.d();
|
|
}
|
|
|
|
void a() {
|
|
d<K, V>.k kVar = this.f21681l;
|
|
if (kVar != null) {
|
|
kVar.a();
|
|
} else {
|
|
d.k(d.this).put(this.f21679j, this.f21680k);
|
|
}
|
|
}
|
|
|
|
@Override // java.util.AbstractCollection, java.util.Collection
|
|
public boolean add(V v10) {
|
|
h();
|
|
boolean isEmpty = this.f21680k.isEmpty();
|
|
boolean add = this.f21680k.add(v10);
|
|
if (add) {
|
|
d.o(d.this);
|
|
if (isEmpty) {
|
|
a();
|
|
}
|
|
}
|
|
return add;
|
|
}
|
|
|
|
@Override // java.util.AbstractCollection, java.util.Collection
|
|
public boolean addAll(Collection<? extends V> collection) {
|
|
if (collection.isEmpty()) {
|
|
return false;
|
|
}
|
|
int size = size();
|
|
boolean addAll = this.f21680k.addAll(collection);
|
|
if (addAll) {
|
|
int size2 = this.f21680k.size();
|
|
d dVar = d.this;
|
|
d.n(dVar, d.m(dVar) + (size2 - size));
|
|
if (size == 0) {
|
|
a();
|
|
}
|
|
}
|
|
return addAll;
|
|
}
|
|
|
|
d<K, V>.k c() {
|
|
return this.f21681l;
|
|
}
|
|
|
|
@Override // java.util.AbstractCollection, java.util.Collection
|
|
public void clear() {
|
|
int size = size();
|
|
if (size != 0) {
|
|
this.f21680k.clear();
|
|
d dVar = d.this;
|
|
d.n(dVar, d.m(dVar) - size);
|
|
i();
|
|
}
|
|
}
|
|
|
|
@Override // java.util.AbstractCollection, java.util.Collection
|
|
public boolean contains(Object obj) {
|
|
h();
|
|
return this.f21680k.contains(obj);
|
|
}
|
|
|
|
@Override // java.util.AbstractCollection, java.util.Collection
|
|
public boolean containsAll(Collection<?> collection) {
|
|
h();
|
|
return this.f21680k.containsAll(collection);
|
|
}
|
|
|
|
Collection<V> d() {
|
|
return this.f21680k;
|
|
}
|
|
|
|
@Override // java.util.Collection
|
|
public boolean equals(Object obj) {
|
|
if (obj == this) {
|
|
return true;
|
|
}
|
|
h();
|
|
return this.f21680k.equals(obj);
|
|
}
|
|
|
|
K g() {
|
|
return this.f21679j;
|
|
}
|
|
|
|
void h() {
|
|
Collection<V> collection;
|
|
d<K, V>.k kVar = this.f21681l;
|
|
if (kVar != null) {
|
|
kVar.h();
|
|
if (this.f21681l.d() != this.f21682m) {
|
|
throw new ConcurrentModificationException();
|
|
}
|
|
} else if (this.f21680k.isEmpty() && (collection = (Collection) d.k(d.this).get(this.f21679j)) != null) {
|
|
this.f21680k = collection;
|
|
}
|
|
}
|
|
|
|
@Override // java.util.Collection
|
|
public int hashCode() {
|
|
h();
|
|
return this.f21680k.hashCode();
|
|
}
|
|
|
|
void i() {
|
|
d<K, V>.k kVar = this.f21681l;
|
|
if (kVar != null) {
|
|
kVar.i();
|
|
} else if (this.f21680k.isEmpty()) {
|
|
d.k(d.this).remove(this.f21679j);
|
|
}
|
|
}
|
|
|
|
@Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable
|
|
public Iterator<V> iterator() {
|
|
h();
|
|
return new a();
|
|
}
|
|
|
|
@Override // java.util.AbstractCollection, java.util.Collection
|
|
public boolean remove(Object obj) {
|
|
h();
|
|
boolean remove = this.f21680k.remove(obj);
|
|
if (remove) {
|
|
d.p(d.this);
|
|
i();
|
|
}
|
|
return remove;
|
|
}
|
|
|
|
@Override // java.util.AbstractCollection, java.util.Collection
|
|
public boolean removeAll(Collection<?> collection) {
|
|
if (collection.isEmpty()) {
|
|
return false;
|
|
}
|
|
int size = size();
|
|
boolean removeAll = this.f21680k.removeAll(collection);
|
|
if (removeAll) {
|
|
int size2 = this.f21680k.size();
|
|
d dVar = d.this;
|
|
d.n(dVar, d.m(dVar) + (size2 - size));
|
|
i();
|
|
}
|
|
return removeAll;
|
|
}
|
|
|
|
@Override // java.util.AbstractCollection, java.util.Collection
|
|
public boolean retainAll(Collection<?> collection) {
|
|
qa.h.j(collection);
|
|
int size = size();
|
|
boolean retainAll = this.f21680k.retainAll(collection);
|
|
if (retainAll) {
|
|
int size2 = this.f21680k.size();
|
|
d dVar = d.this;
|
|
d.n(dVar, d.m(dVar) + (size2 - size));
|
|
i();
|
|
}
|
|
return retainAll;
|
|
}
|
|
|
|
@Override // java.util.AbstractCollection, java.util.Collection
|
|
public int size() {
|
|
h();
|
|
return this.f21680k.size();
|
|
}
|
|
|
|
@Override // java.util.AbstractCollection
|
|
public String toString() {
|
|
h();
|
|
return this.f21680k.toString();
|
|
}
|
|
}
|
|
|
|
/* compiled from: AbstractMapBasedMultimap.java */
|
|
/* loaded from: classes4.dex */
|
|
class l extends d<K, V>.k implements List<V> {
|
|
|
|
/* compiled from: AbstractMapBasedMultimap.java */
|
|
/* loaded from: classes4.dex */
|
|
private class a extends d<K, V>.k.a implements ListIterator<V> {
|
|
a() {
|
|
super();
|
|
}
|
|
|
|
public a(int i10) {
|
|
super(l.this.k().listIterator(i10));
|
|
}
|
|
|
|
private ListIterator<V> d() {
|
|
return (ListIterator) b();
|
|
}
|
|
|
|
@Override // java.util.ListIterator
|
|
public void add(V v10) {
|
|
boolean isEmpty = l.this.isEmpty();
|
|
d().add(v10);
|
|
d.o(d.this);
|
|
if (isEmpty) {
|
|
l.this.a();
|
|
}
|
|
}
|
|
|
|
@Override // java.util.ListIterator
|
|
public boolean hasPrevious() {
|
|
return d().hasPrevious();
|
|
}
|
|
|
|
@Override // java.util.ListIterator
|
|
public int nextIndex() {
|
|
return d().nextIndex();
|
|
}
|
|
|
|
@Override // java.util.ListIterator
|
|
public V previous() {
|
|
return d().previous();
|
|
}
|
|
|
|
@Override // java.util.ListIterator
|
|
public int previousIndex() {
|
|
return d().previousIndex();
|
|
}
|
|
|
|
@Override // java.util.ListIterator
|
|
public void set(V v10) {
|
|
d().set(v10);
|
|
}
|
|
}
|
|
|
|
l(K k2, List<V> list, d<K, V>.k kVar) {
|
|
super(k2, list, kVar);
|
|
}
|
|
|
|
@Override // java.util.List
|
|
public void add(int i10, V v10) {
|
|
h();
|
|
boolean isEmpty = d().isEmpty();
|
|
k().add(i10, v10);
|
|
d.o(d.this);
|
|
if (isEmpty) {
|
|
a();
|
|
}
|
|
}
|
|
|
|
@Override // java.util.List
|
|
public boolean addAll(int i10, Collection<? extends V> collection) {
|
|
if (collection.isEmpty()) {
|
|
return false;
|
|
}
|
|
int size = size();
|
|
boolean addAll = k().addAll(i10, collection);
|
|
if (addAll) {
|
|
int size2 = d().size();
|
|
d dVar = d.this;
|
|
d.n(dVar, d.m(dVar) + (size2 - size));
|
|
if (size == 0) {
|
|
a();
|
|
}
|
|
}
|
|
return addAll;
|
|
}
|
|
|
|
@Override // java.util.List
|
|
public V get(int i10) {
|
|
h();
|
|
return k().get(i10);
|
|
}
|
|
|
|
@Override // java.util.List
|
|
public int indexOf(Object obj) {
|
|
h();
|
|
return k().indexOf(obj);
|
|
}
|
|
|
|
List<V> k() {
|
|
return (List) d();
|
|
}
|
|
|
|
@Override // java.util.List
|
|
public int lastIndexOf(Object obj) {
|
|
h();
|
|
return k().lastIndexOf(obj);
|
|
}
|
|
|
|
@Override // java.util.List
|
|
public ListIterator<V> listIterator() {
|
|
h();
|
|
return new a();
|
|
}
|
|
|
|
@Override // java.util.List
|
|
public ListIterator<V> listIterator(int i10) {
|
|
h();
|
|
return new a(i10);
|
|
}
|
|
|
|
@Override // java.util.List
|
|
public V remove(int i10) {
|
|
h();
|
|
V remove = k().remove(i10);
|
|
d.p(d.this);
|
|
i();
|
|
return remove;
|
|
}
|
|
|
|
@Override // java.util.List
|
|
public V set(int i10, V v10) {
|
|
h();
|
|
return k().set(i10, v10);
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
@Override // java.util.List
|
|
public List<V> subList(int i10, int i11) {
|
|
h();
|
|
return d.this.z(g(), k().subList(i10, i11), c() == null ? this : c());
|
|
}
|
|
}
|
|
|
|
protected d(Map<K, Collection<V>> map) {
|
|
qa.h.d(map.isEmpty());
|
|
this.f21654n = map;
|
|
}
|
|
|
|
static /* synthetic */ Map k(d dVar) {
|
|
return dVar.f21654n;
|
|
}
|
|
|
|
static /* synthetic */ Iterator l(Collection collection) {
|
|
return v(collection);
|
|
}
|
|
|
|
static /* synthetic */ int m(d dVar) {
|
|
return dVar.f21655o;
|
|
}
|
|
|
|
static /* synthetic */ int n(d dVar, int i10) {
|
|
dVar.f21655o = i10;
|
|
return i10;
|
|
}
|
|
|
|
static /* synthetic */ int o(d dVar) {
|
|
int i10 = dVar.f21655o;
|
|
dVar.f21655o = i10 + 1;
|
|
return i10;
|
|
}
|
|
|
|
static /* synthetic */ int p(d dVar) {
|
|
int i10 = dVar.f21655o;
|
|
dVar.f21655o = i10 - 1;
|
|
return i10;
|
|
}
|
|
|
|
static /* synthetic */ void q(d dVar, Object obj) {
|
|
dVar.w(obj);
|
|
}
|
|
|
|
private static <E> Iterator<E> v(Collection<E> collection) {
|
|
return collection instanceof List ? ((List) collection).listIterator() : collection.iterator();
|
|
}
|
|
|
|
private void w(Object obj) {
|
|
Collection collection = (Collection) c0.h(this.f21654n, obj);
|
|
if (collection != null) {
|
|
int size = collection.size();
|
|
collection.clear();
|
|
this.f21655o -= size;
|
|
}
|
|
}
|
|
|
|
@Override // ra.f, ra.d0
|
|
public Collection<Map.Entry<K, V>> a() {
|
|
return super.a();
|
|
}
|
|
|
|
@Override // ra.d0
|
|
public void clear() {
|
|
for (Collection<V> collection : this.f21654n.values()) {
|
|
collection.clear();
|
|
}
|
|
this.f21654n.clear();
|
|
this.f21655o = 0;
|
|
}
|
|
|
|
@Override // ra.f
|
|
Collection<Map.Entry<K, V>> e() {
|
|
return new f.a();
|
|
}
|
|
|
|
@Override // ra.f
|
|
Collection<V> g() {
|
|
return new f.b();
|
|
}
|
|
|
|
@Override // ra.d0
|
|
public Collection<V> get(K k2) {
|
|
Collection<V> collection = this.f21654n.get(k2);
|
|
if (collection == null) {
|
|
collection = s(k2);
|
|
}
|
|
return y(k2, collection);
|
|
}
|
|
|
|
@Override // ra.f
|
|
Iterator<Map.Entry<K, V>> h() {
|
|
return new b();
|
|
}
|
|
|
|
@Override // ra.f
|
|
Iterator<V> j() {
|
|
return new a();
|
|
}
|
|
|
|
@Override // ra.d0
|
|
public boolean put(K k2, V v10) {
|
|
Collection<V> collection = this.f21654n.get(k2);
|
|
if (collection == null) {
|
|
Collection<V> s10 = s(k2);
|
|
if (s10.add(v10)) {
|
|
this.f21655o++;
|
|
this.f21654n.put(k2, s10);
|
|
return true;
|
|
}
|
|
throw new AssertionError("New Collection violated the Collection spec");
|
|
} else if (!collection.add(v10)) {
|
|
return false;
|
|
} else {
|
|
this.f21655o++;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
abstract Collection<V> r();
|
|
|
|
Collection<V> s(K k2) {
|
|
return r();
|
|
}
|
|
|
|
@Override // ra.d0
|
|
public int size() {
|
|
return this.f21655o;
|
|
}
|
|
|
|
final Map<K, Collection<V>> t() {
|
|
Map<K, Collection<V>> map = this.f21654n;
|
|
return map instanceof NavigableMap ? new f((NavigableMap) this.f21654n) : map instanceof SortedMap ? new i((SortedMap) this.f21654n) : new c(this.f21654n);
|
|
}
|
|
|
|
final Set<K> u() {
|
|
Map<K, Collection<V>> map = this.f21654n;
|
|
return map instanceof NavigableMap ? new g((NavigableMap) this.f21654n) : map instanceof SortedMap ? new j((SortedMap) this.f21654n) : new e(this.f21654n);
|
|
}
|
|
|
|
@Override // ra.f, ra.d0
|
|
public Collection<V> values() {
|
|
return super.values();
|
|
}
|
|
|
|
abstract <E> Collection<E> x(Collection<E> collection);
|
|
|
|
abstract Collection<V> y(K k2, Collection<V> collection);
|
|
|
|
final List<V> z(K k2, List<V> list, d<K, V>.k kVar) {
|
|
return list instanceof RandomAccess ? new h(k2, list, kVar) : new l(k2, list, kVar);
|
|
}
|
|
}
|