- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
269 lines
7.5 KiB
Java
269 lines
7.5 KiB
Java
package com.google.android.gms.internal.measurement;
|
|
|
|
import java.lang.Comparable;
|
|
import java.util.AbstractMap;
|
|
import java.util.ArrayList;
|
|
import java.util.Collections;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Set;
|
|
import java.util.SortedMap;
|
|
import java.util.TreeMap;
|
|
|
|
/* loaded from: classes3.dex */
|
|
class zzln<K extends Comparable<K>, V> extends AbstractMap<K, V> {
|
|
private final int zza;
|
|
private List<zzlt> zzb;
|
|
private Map<K, V> zzc;
|
|
private boolean zzd;
|
|
private volatile zzlu zze;
|
|
private Map<K, V> zzf;
|
|
private volatile zzlr zzg;
|
|
|
|
public final boolean zze() {
|
|
return this.zzd;
|
|
}
|
|
|
|
private final int zza(K k) {
|
|
int i;
|
|
int size = this.zzb.size();
|
|
int i2 = size - 1;
|
|
if (i2 >= 0) {
|
|
int compareTo = k.compareTo((Comparable) this.zzb.get(i2).getKey());
|
|
if (compareTo > 0) {
|
|
i = size + 1;
|
|
return -i;
|
|
}
|
|
if (compareTo == 0) {
|
|
return i2;
|
|
}
|
|
}
|
|
int i3 = 0;
|
|
while (i3 <= i2) {
|
|
int i4 = (i3 + i2) / 2;
|
|
int compareTo2 = k.compareTo((Comparable) this.zzb.get(i4).getKey());
|
|
if (compareTo2 < 0) {
|
|
i2 = i4 - 1;
|
|
} else {
|
|
if (compareTo2 <= 0) {
|
|
return i4;
|
|
}
|
|
i3 = i4 + 1;
|
|
}
|
|
}
|
|
i = i3 + 1;
|
|
return -i;
|
|
}
|
|
|
|
public final int zzb() {
|
|
return this.zzb.size();
|
|
}
|
|
|
|
@Override // java.util.AbstractMap, java.util.Map
|
|
public int hashCode() {
|
|
int zzb = zzb();
|
|
int i = 0;
|
|
for (int i2 = 0; i2 < zzb; i2++) {
|
|
i += this.zzb.get(i2).hashCode();
|
|
}
|
|
return this.zzc.size() > 0 ? i + this.zzc.hashCode() : i;
|
|
}
|
|
|
|
@Override // java.util.AbstractMap, java.util.Map
|
|
public int size() {
|
|
return this.zzb.size() + this.zzc.size();
|
|
}
|
|
|
|
public static <FieldDescriptorType extends zzjc<FieldDescriptorType>> zzln<FieldDescriptorType, Object> zza(int i) {
|
|
return new zzlm(i);
|
|
}
|
|
|
|
public final Iterable<Map.Entry<K, V>> zzc() {
|
|
if (this.zzc.isEmpty()) {
|
|
return Collections.emptySet();
|
|
}
|
|
return this.zzc.entrySet();
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
@Override // java.util.AbstractMap, java.util.Map
|
|
public V get(Object obj) {
|
|
Comparable comparable = (Comparable) obj;
|
|
int zza = zza((zzln<K, V>) comparable);
|
|
if (zza >= 0) {
|
|
return (V) this.zzb.get(zza).getValue();
|
|
}
|
|
return this.zzc.get(comparable);
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public final V zza(K k, V v) {
|
|
zzg();
|
|
int zza = zza((zzln<K, V>) k);
|
|
if (zza >= 0) {
|
|
return (V) this.zzb.get(zza).setValue(v);
|
|
}
|
|
zzg();
|
|
if (this.zzb.isEmpty() && !(this.zzb instanceof ArrayList)) {
|
|
this.zzb = new ArrayList(this.zza);
|
|
}
|
|
int i = -(zza + 1);
|
|
if (i >= this.zza) {
|
|
return zzf().put(k, v);
|
|
}
|
|
int size = this.zzb.size();
|
|
int i2 = this.zza;
|
|
if (size == i2) {
|
|
zzlt remove = this.zzb.remove(i2 - 1);
|
|
zzf().put((Comparable) remove.getKey(), remove.getValue());
|
|
}
|
|
this.zzb.add(i, new zzlt(this, k, v));
|
|
return null;
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
@Override // java.util.AbstractMap, java.util.Map
|
|
public /* synthetic */ Object put(Object obj, Object obj2) {
|
|
return zza((zzln<K, V>) obj, (Comparable) obj2);
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
@Override // java.util.AbstractMap, java.util.Map
|
|
public V remove(Object obj) {
|
|
zzg();
|
|
Comparable comparable = (Comparable) obj;
|
|
int zza = zza((zzln<K, V>) comparable);
|
|
if (zza >= 0) {
|
|
return (V) zzc(zza);
|
|
}
|
|
if (this.zzc.isEmpty()) {
|
|
return null;
|
|
}
|
|
return this.zzc.remove(comparable);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public final V zzc(int i) {
|
|
zzg();
|
|
V v = (V) this.zzb.remove(i).getValue();
|
|
if (!this.zzc.isEmpty()) {
|
|
Iterator<Map.Entry<K, V>> it = zzf().entrySet().iterator();
|
|
this.zzb.add(new zzlt(this, it.next()));
|
|
it.remove();
|
|
}
|
|
return v;
|
|
}
|
|
|
|
public final Map.Entry<K, V> zzb(int i) {
|
|
return this.zzb.get(i);
|
|
}
|
|
|
|
public final Set<Map.Entry<K, V>> zzd() {
|
|
if (this.zzg == null) {
|
|
this.zzg = new zzlr(this);
|
|
}
|
|
return this.zzg;
|
|
}
|
|
|
|
@Override // java.util.AbstractMap, java.util.Map
|
|
public Set<Map.Entry<K, V>> entrySet() {
|
|
if (this.zze == null) {
|
|
this.zze = new zzlu(this);
|
|
}
|
|
return this.zze;
|
|
}
|
|
|
|
private final SortedMap<K, V> zzf() {
|
|
zzg();
|
|
if (this.zzc.isEmpty() && !(this.zzc instanceof TreeMap)) {
|
|
TreeMap treeMap = new TreeMap();
|
|
this.zzc = treeMap;
|
|
this.zzf = treeMap.descendingMap();
|
|
}
|
|
return (SortedMap) this.zzc;
|
|
}
|
|
|
|
private zzln(int i) {
|
|
this.zza = i;
|
|
this.zzb = Collections.emptyList();
|
|
this.zzc = Collections.emptyMap();
|
|
this.zzf = Collections.emptyMap();
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public final void zzg() {
|
|
if (this.zzd) {
|
|
throw new UnsupportedOperationException();
|
|
}
|
|
}
|
|
|
|
@Override // java.util.AbstractMap, java.util.Map
|
|
public void clear() {
|
|
zzg();
|
|
if (!this.zzb.isEmpty()) {
|
|
this.zzb.clear();
|
|
}
|
|
if (this.zzc.isEmpty()) {
|
|
return;
|
|
}
|
|
this.zzc.clear();
|
|
}
|
|
|
|
public void zza() {
|
|
Map<K, V> unmodifiableMap;
|
|
Map<K, V> unmodifiableMap2;
|
|
if (this.zzd) {
|
|
return;
|
|
}
|
|
if (this.zzc.isEmpty()) {
|
|
unmodifiableMap = Collections.emptyMap();
|
|
} else {
|
|
unmodifiableMap = Collections.unmodifiableMap(this.zzc);
|
|
}
|
|
this.zzc = unmodifiableMap;
|
|
if (this.zzf.isEmpty()) {
|
|
unmodifiableMap2 = Collections.emptyMap();
|
|
} else {
|
|
unmodifiableMap2 = Collections.unmodifiableMap(this.zzf);
|
|
}
|
|
this.zzf = unmodifiableMap2;
|
|
this.zzd = true;
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
@Override // java.util.AbstractMap, java.util.Map
|
|
public boolean containsKey(Object obj) {
|
|
Comparable comparable = (Comparable) obj;
|
|
return zza((zzln<K, V>) comparable) >= 0 || this.zzc.containsKey(comparable);
|
|
}
|
|
|
|
@Override // java.util.AbstractMap, java.util.Map
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof zzln)) {
|
|
return super.equals(obj);
|
|
}
|
|
zzln zzlnVar = (zzln) obj;
|
|
int size = size();
|
|
if (size != zzlnVar.size()) {
|
|
return false;
|
|
}
|
|
int zzb = zzb();
|
|
if (zzb != zzlnVar.zzb()) {
|
|
return entrySet().equals(zzlnVar.entrySet());
|
|
}
|
|
for (int i = 0; i < zzb; i++) {
|
|
if (!zzb(i).equals(zzlnVar.zzb(i))) {
|
|
return false;
|
|
}
|
|
}
|
|
if (zzb != size) {
|
|
return this.zzc.equals(zzlnVar.zzc);
|
|
}
|
|
return true;
|
|
}
|
|
}
|