package com.google.android.gms.internal.clearcut; import java.util.Arrays; import java.util.Collection; import java.util.RandomAccess; /* loaded from: classes2.dex */ final class zzce extends zzav implements zzcn, RandomAccess { private static final zzce zzjm; private int size; private float[] zzjn; @Override // com.google.android.gms.internal.clearcut.zzcn public final /* synthetic */ zzcn zzi(int i) { if (i >= this.size) { return new zzce(Arrays.copyOf(this.zzjn, i), this.size); } throw new IllegalArgumentException(); } public final void zzc(float f) { zzc(this.size, f); } @Override // java.util.AbstractCollection, java.util.Collection, java.util.List public final int size() { return this.size; } @Override // com.google.android.gms.internal.clearcut.zzav, java.util.AbstractList, java.util.List public final /* synthetic */ Object set(int i, Object obj) { float floatValue = ((Float) obj).floatValue(); zzw(); zzg(i); float[] fArr = this.zzjn; float f = fArr[i]; fArr[i] = floatValue; return Float.valueOf(f); } @Override // java.util.AbstractList protected final void removeRange(int i, int i2) { zzw(); if (i2 < i) { throw new IndexOutOfBoundsException("toIndex < fromIndex"); } float[] fArr = this.zzjn; System.arraycopy(fArr, i2, fArr, i, this.size - i2); this.size -= i2 - i; this.modCount++; } @Override // com.google.android.gms.internal.clearcut.zzav, java.util.AbstractCollection, java.util.Collection, java.util.List public final boolean remove(Object obj) { zzw(); for (int i = 0; i < this.size; i++) { if (obj.equals(Float.valueOf(this.zzjn[i]))) { float[] fArr = this.zzjn; System.arraycopy(fArr, i + 1, fArr, i, this.size - i); this.size--; this.modCount++; return true; } } return false; } @Override // com.google.android.gms.internal.clearcut.zzav, java.util.AbstractList, java.util.List public final /* synthetic */ Object remove(int i) { zzw(); zzg(i); float[] fArr = this.zzjn; float f = fArr[i]; int i2 = this.size; if (i < i2 - 1) { System.arraycopy(fArr, i + 1, fArr, i, i2 - i); } this.size--; this.modCount++; return Float.valueOf(f); } @Override // com.google.android.gms.internal.clearcut.zzav, 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.zzjn[i2]); } return i; } @Override // java.util.AbstractList, java.util.List public final /* synthetic */ Object get(int i) { zzg(i); return Float.valueOf(this.zzjn[i]); } @Override // com.google.android.gms.internal.clearcut.zzav, java.util.AbstractList, java.util.Collection, java.util.List public final boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof zzce)) { return super.equals(obj); } zzce zzceVar = (zzce) obj; if (this.size != zzceVar.size) { return false; } float[] fArr = zzceVar.zzjn; for (int i = 0; i < this.size; i++) { if (this.zzjn[i] != fArr[i]) { return false; } } return true; } @Override // com.google.android.gms.internal.clearcut.zzav, java.util.AbstractCollection, java.util.Collection, java.util.List public final boolean addAll(Collection collection) { zzw(); zzci.checkNotNull(collection); if (!(collection instanceof zzce)) { return super.addAll(collection); } zzce zzceVar = (zzce) collection; int i = zzceVar.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.zzjn; if (i3 > fArr.length) { this.zzjn = Arrays.copyOf(fArr, i3); } System.arraycopy(zzceVar.zzjn, 0, this.zzjn, this.size, zzceVar.size); this.size = i3; this.modCount++; return true; } @Override // com.google.android.gms.internal.clearcut.zzav, java.util.AbstractList, java.util.List public final /* synthetic */ void add(int i, Object obj) { zzc(i, ((Float) obj).floatValue()); } private final String zzh(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(); } private final void zzg(int i) { if (i < 0 || i >= this.size) { throw new IndexOutOfBoundsException(zzh(i)); } } private final void zzc(int i, float f) { int i2; zzw(); if (i < 0 || i > (i2 = this.size)) { throw new IndexOutOfBoundsException(zzh(i)); } float[] fArr = this.zzjn; 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.zzjn, i, fArr2, i + 1, this.size - i); this.zzjn = fArr2; } this.zzjn[i] = f; this.size++; this.modCount++; } private zzce(float[] fArr, int i) { this.zzjn = fArr; this.size = i; } zzce() { this(new float[10], 0); } static { zzce zzceVar = new zzce(); zzjm = zzceVar; zzceVar.zzv(); } }