what-the-bank/sources/com/google/android/gms/internal/measurement/zzjq.java

220 lines
6.6 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.google.android.gms.internal.measurement;
import java.util.Arrays;
import java.util.Collection;
import java.util.RandomAccess;
/* loaded from: classes.dex */
final class zzjq extends zzii<Float> implements RandomAccess, zzke, zzlj {
private static final zzjq zza;
private float[] zzb;
private int zzc;
static {
zzjq zzjqVar = new zzjq(new float[0], 0);
zza = zzjqVar;
zzjqVar.zzb();
}
zzjq() {
this(new float[10], 0);
}
private final String zzf(int i) {
int i2 = this.zzc;
StringBuilder sb = new StringBuilder(35);
sb.append("Index:");
sb.append(i);
sb.append(", Size:");
sb.append(i2);
return sb.toString();
}
private final void zzg(int i) {
if (i < 0 || i >= this.zzc) {
throw new IndexOutOfBoundsException(zzf(i));
}
}
@Override // com.google.android.gms.internal.measurement.zzii, java.util.AbstractList, java.util.List
public final /* synthetic */ void add(int i, Object obj) {
int i2;
float floatValue = ((Float) obj).floatValue();
zzbM();
if (i < 0 || i > (i2 = this.zzc)) {
throw new IndexOutOfBoundsException(zzf(i));
}
float[] fArr = this.zzb;
if (i2 < fArr.length) {
System.arraycopy(fArr, i, fArr, i + 1, i2 - i);
} else {
float[] fArr2 = new float[((i2 * 3) / 2) + 1];
System.arraycopy(fArr, 0, fArr2, 0, i);
System.arraycopy(this.zzb, i, fArr2, i + 1, this.zzc - i);
this.zzb = fArr2;
}
this.zzb[i] = floatValue;
this.zzc++;
this.modCount++;
}
@Override // com.google.android.gms.internal.measurement.zzii, java.util.AbstractCollection, java.util.Collection, java.util.List
public final boolean addAll(Collection<? extends Float> collection) {
zzbM();
zzkf.zze(collection);
if (!(collection instanceof zzjq)) {
return super.addAll(collection);
}
zzjq zzjqVar = (zzjq) collection;
int i = zzjqVar.zzc;
if (i == 0) {
return false;
}
int i2 = this.zzc;
if (Integer.MAX_VALUE - i2 < i) {
throw new OutOfMemoryError();
}
int i3 = i2 + i;
float[] fArr = this.zzb;
if (i3 > fArr.length) {
this.zzb = Arrays.copyOf(fArr, i3);
}
System.arraycopy(zzjqVar.zzb, 0, this.zzb, this.zzc, zzjqVar.zzc);
this.zzc = i3;
this.modCount++;
return true;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public final boolean contains(Object obj) {
return indexOf(obj) != -1;
}
@Override // com.google.android.gms.internal.measurement.zzii, java.util.AbstractList, java.util.Collection, java.util.List
public final boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof zzjq)) {
return super.equals(obj);
}
zzjq zzjqVar = (zzjq) obj;
if (this.zzc != zzjqVar.zzc) {
return false;
}
float[] fArr = zzjqVar.zzb;
for (int i = 0; i < this.zzc; i++) {
if (Float.floatToIntBits(this.zzb[i]) != Float.floatToIntBits(fArr[i])) {
return false;
}
}
return true;
}
@Override // java.util.AbstractList, java.util.List
public final /* synthetic */ Object get(int i) {
zzg(i);
return Float.valueOf(this.zzb[i]);
}
@Override // com.google.android.gms.internal.measurement.zzii, java.util.AbstractList, java.util.Collection, java.util.List
public final int hashCode() {
int i = 1;
for (int i2 = 0; i2 < this.zzc; i2++) {
i = (i * 31) + Float.floatToIntBits(this.zzb[i2]);
}
return i;
}
@Override // java.util.AbstractList, java.util.List
public final int indexOf(Object obj) {
if (!(obj instanceof Float)) {
return -1;
}
float floatValue = ((Float) obj).floatValue();
int i = this.zzc;
for (int i2 = 0; i2 < i; i2++) {
if (this.zzb[i2] == floatValue) {
return i2;
}
}
return -1;
}
@Override // com.google.android.gms.internal.measurement.zzii, java.util.AbstractList, java.util.List
public final /* synthetic */ Object remove(int i) {
zzbM();
zzg(i);
float[] fArr = this.zzb;
float f = fArr[i];
if (i < this.zzc - 1) {
System.arraycopy(fArr, i + 1, fArr, i, (r2 - i) - 1);
}
this.zzc--;
this.modCount++;
return Float.valueOf(f);
}
@Override // java.util.AbstractList
protected final void removeRange(int i, int i2) {
zzbM();
if (i2 < i) {
throw new IndexOutOfBoundsException("toIndex < fromIndex");
}
float[] fArr = this.zzb;
System.arraycopy(fArr, i2, fArr, i, this.zzc - i2);
this.zzc -= i2 - i;
this.modCount++;
}
@Override // com.google.android.gms.internal.measurement.zzii, java.util.AbstractList, java.util.List
public final /* synthetic */ Object set(int i, Object obj) {
float floatValue = ((Float) obj).floatValue();
zzbM();
zzg(i);
float[] fArr = this.zzb;
float f = fArr[i];
fArr[i] = floatValue;
return Float.valueOf(f);
}
@Override // com.google.android.gms.internal.measurement.zzke
public final /* synthetic */ zzke zzd(int i) {
if (i < this.zzc) {
throw new IllegalArgumentException();
}
return new zzjq(Arrays.copyOf(this.zzb, i), this.zzc);
}
public final void zze(float f) {
zzbM();
int i = this.zzc;
float[] fArr = this.zzb;
if (i == fArr.length) {
float[] fArr2 = new float[((i * 3) / 2) + 1];
System.arraycopy(fArr, 0, fArr2, 0, i);
this.zzb = fArr2;
}
float[] fArr3 = this.zzb;
int i2 = this.zzc;
this.zzc = i2 + 1;
fArr3[i2] = f;
}
private zzjq(float[] fArr, int i) {
this.zzb = fArr;
this.zzc = i;
}
@Override // com.google.android.gms.internal.measurement.zzii, java.util.AbstractList, java.util.AbstractCollection, java.util.Collection, java.util.List
public final /* synthetic */ boolean add(Object obj) {
zze(((Float) obj).floatValue());
return true;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public final int size() {
return this.zzc;
}
}