what-the-bank/sources/com/google/android/gms/internal/gtm/zzqz.java

201 lines
6.1 KiB
Java

package com.google.android.gms.internal.gtm;
import java.util.Arrays;
import java.util.Collection;
import java.util.RandomAccess;
/* loaded from: classes2.dex */
final class zzqz extends zzpo<Float> implements zzrj<Float>, zzsv, RandomAccess {
private static final zzqz zzbag;
private int size;
private float[] zzbah;
zzqz() {
this(new float[10], 0);
}
private zzqz(float[] fArr, int i) {
this.zzbah = fArr;
this.size = i;
}
@Override // java.util.AbstractList
protected final void removeRange(int i, int i2) {
zzmz();
if (i2 < i) {
throw new IndexOutOfBoundsException("toIndex < fromIndex");
}
float[] fArr = this.zzbah;
System.arraycopy(fArr, i2, fArr, i, this.size - i2);
this.size -= i2 - i;
this.modCount++;
}
@Override // com.google.android.gms.internal.gtm.zzpo, java.util.AbstractList, java.util.Collection, java.util.List
public final boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof zzqz)) {
return super.equals(obj);
}
zzqz zzqzVar = (zzqz) obj;
if (this.size != zzqzVar.size) {
return false;
}
float[] fArr = zzqzVar.zzbah;
for (int i = 0; i < this.size; i++) {
if (Float.floatToIntBits(this.zzbah[i]) != Float.floatToIntBits(fArr[i])) {
return false;
}
}
return true;
}
@Override // com.google.android.gms.internal.gtm.zzpo, java.util.AbstractList, java.util.Collection, java.util.List
public final int hashCode() {
int i = 1;
for (int i2 = 0; i2 < this.size; i2++) {
i = (i * 31) + Float.floatToIntBits(this.zzbah[i2]);
}
return i;
}
public final void zzc(float f) {
zzc(this.size, f);
}
private final void zzc(int i, float f) {
int i2;
zzmz();
if (i < 0 || i > (i2 = this.size)) {
throw new IndexOutOfBoundsException(zzai(i));
}
float[] fArr = this.zzbah;
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.zzbah, i, fArr2, i + 1, this.size - i);
this.zzbah = fArr2;
}
this.zzbah[i] = f;
this.size++;
this.modCount++;
}
@Override // com.google.android.gms.internal.gtm.zzpo, java.util.AbstractCollection, java.util.Collection, java.util.List
public final boolean addAll(Collection<? extends Float> collection) {
zzmz();
zzre.checkNotNull(collection);
if (!(collection instanceof zzqz)) {
return super.addAll(collection);
}
zzqz zzqzVar = (zzqz) collection;
int i = zzqzVar.size;
if (i == 0) {
return false;
}
int i2 = this.size;
if (Integer.MAX_VALUE - i2 < i) {
throw new OutOfMemoryError();
}
int i3 = i2 + i;
float[] fArr = this.zzbah;
if (i3 > fArr.length) {
this.zzbah = Arrays.copyOf(fArr, i3);
}
System.arraycopy(zzqzVar.zzbah, 0, this.zzbah, this.size, zzqzVar.size);
this.size = i3;
this.modCount++;
return true;
}
@Override // com.google.android.gms.internal.gtm.zzpo, java.util.AbstractCollection, java.util.Collection, java.util.List
public final boolean remove(Object obj) {
zzmz();
for (int i = 0; i < this.size; i++) {
if (obj.equals(Float.valueOf(this.zzbah[i]))) {
float[] fArr = this.zzbah;
System.arraycopy(fArr, i + 1, fArr, i, (this.size - i) - 1);
this.size--;
this.modCount++;
return true;
}
}
return false;
}
private final void zzah(int i) {
if (i < 0 || i >= this.size) {
throw new IndexOutOfBoundsException(zzai(i));
}
}
private final String zzai(int i) {
int i2 = this.size;
StringBuilder sb = new StringBuilder(35);
sb.append("Index:");
sb.append(i);
sb.append(", Size:");
sb.append(i2);
return sb.toString();
}
@Override // com.google.android.gms.internal.gtm.zzpo, java.util.AbstractList, java.util.List
public final /* synthetic */ Object set(int i, Object obj) {
float floatValue = ((Float) obj).floatValue();
zzmz();
zzah(i);
float[] fArr = this.zzbah;
float f = fArr[i];
fArr[i] = floatValue;
return Float.valueOf(f);
}
@Override // com.google.android.gms.internal.gtm.zzpo, java.util.AbstractList, java.util.List
public final /* synthetic */ Object remove(int i) {
zzmz();
zzah(i);
float[] fArr = this.zzbah;
float f = fArr[i];
if (i < this.size - 1) {
System.arraycopy(fArr, i + 1, fArr, i, (r2 - i) - 1);
}
this.size--;
this.modCount++;
return Float.valueOf(f);
}
@Override // com.google.android.gms.internal.gtm.zzpo, java.util.AbstractList, java.util.List
public final /* synthetic */ void add(int i, Object obj) {
zzc(i, ((Float) obj).floatValue());
}
@Override // com.google.android.gms.internal.gtm.zzrj
public final /* synthetic */ zzrj<Float> zzaj(int i) {
if (i < this.size) {
throw new IllegalArgumentException();
}
return new zzqz(Arrays.copyOf(this.zzbah, i), this.size);
}
@Override // java.util.AbstractList, java.util.List
public final /* synthetic */ Object get(int i) {
zzah(i);
return Float.valueOf(this.zzbah[i]);
}
static {
zzqz zzqzVar = new zzqz(new float[0], 0);
zzbag = zzqzVar;
zzqzVar.zzmi();
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public final int size() {
return this.size;
}
}