jimu-decompiled/sources/com/google/android/gms/internal/measurement/zzul.java
2025-05-13 19:24:51 +02:00

199 lines
5.8 KiB
Java

package com.google.android.gms.internal.measurement;
import java.util.AbstractList;
import java.util.Arrays;
import java.util.Collection;
import java.util.RandomAccess;
/* loaded from: classes.dex */
final class zzul extends zzta<Float> implements zzuu<Float>, zzwg, RandomAccess {
private float[] b;
private int c;
static {
new zzul().i();
}
zzul() {
this(new float[10], 0);
}
private final void c(int i) {
if (i < 0 || i >= this.c) {
throw new IndexOutOfBoundsException(d(i));
}
}
private final String d(int i) {
int i2 = this.c;
StringBuilder sb = new StringBuilder(35);
sb.append("Index:");
sb.append(i);
sb.append(", Size:");
sb.append(i2);
return sb.toString();
}
public final void a(float f) {
a(this.c, f);
}
@Override // java.util.AbstractList, java.util.List
public final /* synthetic */ void add(int i, Object obj) {
a(i, ((Float) obj).floatValue());
}
@Override // com.google.android.gms.internal.measurement.zzta, java.util.AbstractCollection, java.util.Collection, java.util.List
public final boolean addAll(Collection<? extends Float> collection) {
a();
zzuq.a(collection);
if (!(collection instanceof zzul)) {
return super.addAll(collection);
}
zzul zzulVar = (zzul) collection;
int i = zzulVar.c;
if (i == 0) {
return false;
}
int i2 = this.c;
if (Integer.MAX_VALUE - i2 < i) {
throw new OutOfMemoryError();
}
int i3 = i2 + i;
float[] fArr = this.b;
if (i3 > fArr.length) {
this.b = Arrays.copyOf(fArr, i3);
}
System.arraycopy(zzulVar.b, 0, this.b, this.c, zzulVar.c);
this.c = i3;
((AbstractList) this).modCount++;
return true;
}
@Override // com.google.android.gms.internal.measurement.zzta, java.util.AbstractList, java.util.Collection, java.util.List
public final boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof zzul)) {
return super.equals(obj);
}
zzul zzulVar = (zzul) obj;
if (this.c != zzulVar.c) {
return false;
}
float[] fArr = zzulVar.b;
for (int i = 0; i < this.c; i++) {
if (Float.floatToIntBits(this.b[i]) != Float.floatToIntBits(fArr[i])) {
return false;
}
}
return true;
}
@Override // java.util.AbstractList, java.util.List
public final /* synthetic */ Object get(int i) {
c(i);
return Float.valueOf(this.b[i]);
}
@Override // com.google.android.gms.internal.measurement.zzta, java.util.AbstractList, java.util.Collection, java.util.List
public final int hashCode() {
int i = 1;
for (int i2 = 0; i2 < this.c; i2++) {
i = (i * 31) + Float.floatToIntBits(this.b[i2]);
}
return i;
}
@Override // com.google.android.gms.internal.measurement.zzta, java.util.AbstractCollection, java.util.Collection, java.util.List
public final boolean remove(Object obj) {
a();
for (int i = 0; i < this.c; i++) {
if (obj.equals(Float.valueOf(this.b[i]))) {
float[] fArr = this.b;
System.arraycopy(fArr, i + 1, fArr, i, (this.c - i) - 1);
this.c--;
((AbstractList) this).modCount++;
return true;
}
}
return false;
}
@Override // java.util.AbstractList
protected final void removeRange(int i, int i2) {
a();
if (i2 < i) {
throw new IndexOutOfBoundsException("toIndex < fromIndex");
}
float[] fArr = this.b;
System.arraycopy(fArr, i2, fArr, i, this.c - i2);
this.c -= i2 - i;
((AbstractList) this).modCount++;
}
@Override // java.util.AbstractList, java.util.List
public final /* synthetic */ Object set(int i, Object obj) {
float floatValue = ((Float) obj).floatValue();
a();
c(i);
float[] fArr = this.b;
float f = fArr[i];
fArr[i] = floatValue;
return Float.valueOf(f);
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public final int size() {
return this.c;
}
private zzul(float[] fArr, int i) {
this.b = fArr;
this.c = i;
}
private final void a(int i, float f) {
int i2;
a();
if (i < 0 || i > (i2 = this.c)) {
throw new IndexOutOfBoundsException(d(i));
}
float[] fArr = this.b;
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.b, i, fArr2, i + 1, this.c - i);
this.b = fArr2;
}
this.b[i] = f;
this.c++;
((AbstractList) this).modCount++;
}
@Override // java.util.AbstractList, java.util.List
public final /* synthetic */ Object remove(int i) {
a();
c(i);
float[] fArr = this.b;
float f = fArr[i];
if (i < this.c - 1) {
System.arraycopy(fArr, i + 1, fArr, i, (r2 - i) - 1);
}
this.c--;
((AbstractList) this).modCount++;
return Float.valueOf(f);
}
@Override // com.google.android.gms.internal.measurement.zzuu
public final /* synthetic */ zzuu<Float> a(int i) {
if (i >= this.c) {
return new zzul(Arrays.copyOf(this.b, i), this.c);
}
throw new IllegalArgumentException();
}
}