205 lines
6.2 KiB
Java
205 lines
6.2 KiB
Java
|
package com.google.android.gms.internal.firebase_ml;
|
||
|
|
||
|
import java.util.Arrays;
|
||
|
import java.util.Collection;
|
||
|
import java.util.RandomAccess;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
final class zzuc extends zzsq<Float> implements zzun<Float>, zzwa, RandomAccess {
|
||
|
private static final zzuc zzboe;
|
||
|
private int size;
|
||
|
private float[] zzbof;
|
||
|
|
||
|
zzuc() {
|
||
|
this(new float[10], 0);
|
||
|
}
|
||
|
|
||
|
private zzuc(float[] fArr, int i) {
|
||
|
this.zzbof = fArr;
|
||
|
this.size = i;
|
||
|
}
|
||
|
|
||
|
@Override // java.util.AbstractList
|
||
|
protected final void removeRange(int i, int i2) {
|
||
|
zzpu();
|
||
|
if (i2 < i) {
|
||
|
throw new IndexOutOfBoundsException("toIndex < fromIndex");
|
||
|
}
|
||
|
float[] fArr = this.zzbof;
|
||
|
System.arraycopy(fArr, i2, fArr, i, this.size - i2);
|
||
|
this.size -= i2 - i;
|
||
|
this.modCount++;
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzsq, java.util.AbstractList, java.util.Collection, java.util.List
|
||
|
public final boolean equals(Object obj) {
|
||
|
if (this == obj) {
|
||
|
return true;
|
||
|
}
|
||
|
if (!(obj instanceof zzuc)) {
|
||
|
return super.equals(obj);
|
||
|
}
|
||
|
zzuc zzucVar = (zzuc) obj;
|
||
|
if (this.size != zzucVar.size) {
|
||
|
return false;
|
||
|
}
|
||
|
float[] fArr = zzucVar.zzbof;
|
||
|
for (int i = 0; i < this.size; i++) {
|
||
|
if (Float.floatToIntBits(this.zzbof[i]) != Float.floatToIntBits(fArr[i])) {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzsq, 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.zzbof[i2]);
|
||
|
}
|
||
|
return i;
|
||
|
}
|
||
|
|
||
|
public final void zzv(float f) {
|
||
|
zzc(this.size, f);
|
||
|
}
|
||
|
|
||
|
private final void zzc(int i, float f) {
|
||
|
int i2;
|
||
|
zzpu();
|
||
|
if (i < 0 || i > (i2 = this.size)) {
|
||
|
throw new IndexOutOfBoundsException(zzcj(i));
|
||
|
}
|
||
|
float[] fArr = this.zzbof;
|
||
|
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.zzbof, i, fArr2, i + 1, this.size - i);
|
||
|
this.zzbof = fArr2;
|
||
|
}
|
||
|
this.zzbof[i] = f;
|
||
|
this.size++;
|
||
|
this.modCount++;
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzsq, java.util.AbstractCollection, java.util.Collection, java.util.List
|
||
|
public final boolean addAll(Collection<? extends Float> collection) {
|
||
|
zzpu();
|
||
|
zzug.checkNotNull(collection);
|
||
|
if (!(collection instanceof zzuc)) {
|
||
|
return super.addAll(collection);
|
||
|
}
|
||
|
zzuc zzucVar = (zzuc) collection;
|
||
|
int i = zzucVar.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.zzbof;
|
||
|
if (i3 > fArr.length) {
|
||
|
this.zzbof = Arrays.copyOf(fArr, i3);
|
||
|
}
|
||
|
System.arraycopy(zzucVar.zzbof, 0, this.zzbof, this.size, zzucVar.size);
|
||
|
this.size = i3;
|
||
|
this.modCount++;
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzsq, java.util.AbstractCollection, java.util.Collection, java.util.List
|
||
|
public final boolean remove(Object obj) {
|
||
|
zzpu();
|
||
|
for (int i = 0; i < this.size; i++) {
|
||
|
if (obj.equals(Float.valueOf(this.zzbof[i]))) {
|
||
|
float[] fArr = this.zzbof;
|
||
|
System.arraycopy(fArr, i + 1, fArr, i, (this.size - i) - 1);
|
||
|
this.size--;
|
||
|
this.modCount++;
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
private final void zzci(int i) {
|
||
|
if (i < 0 || i >= this.size) {
|
||
|
throw new IndexOutOfBoundsException(zzcj(i));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private final String zzcj(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.firebase_ml.zzsq, java.util.AbstractList, java.util.List
|
||
|
public final /* synthetic */ Object set(int i, Object obj) {
|
||
|
float floatValue = ((Float) obj).floatValue();
|
||
|
zzpu();
|
||
|
zzci(i);
|
||
|
float[] fArr = this.zzbof;
|
||
|
float f = fArr[i];
|
||
|
fArr[i] = floatValue;
|
||
|
return Float.valueOf(f);
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zzsq, java.util.AbstractList, java.util.List
|
||
|
public final /* synthetic */ Object remove(int i) {
|
||
|
zzpu();
|
||
|
zzci(i);
|
||
|
float[] fArr = this.zzbof;
|
||
|
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.firebase_ml.zzsq, 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.firebase_ml.zzun
|
||
|
public final /* synthetic */ zzun<Float> zzck(int i) {
|
||
|
if (i < this.size) {
|
||
|
throw new IllegalArgumentException();
|
||
|
}
|
||
|
return new zzuc(Arrays.copyOf(this.zzbof, i), this.size);
|
||
|
}
|
||
|
|
||
|
@Override // java.util.AbstractList, java.util.List
|
||
|
public final /* synthetic */ Object get(int i) {
|
||
|
zzci(i);
|
||
|
return Float.valueOf(this.zzbof[i]);
|
||
|
}
|
||
|
|
||
|
static {
|
||
|
zzuc zzucVar = new zzuc(new float[0], 0);
|
||
|
zzboe = zzucVar;
|
||
|
zzucVar.zzpt();
|
||
|
}
|
||
|
|
||
|
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
|
||
|
public final int size() {
|
||
|
return this.size;
|
||
|
}
|
||
|
|
||
|
public static zzuc zzqv() {
|
||
|
return zzboe;
|
||
|
}
|
||
|
}
|