what-the-bank/sources/o/Yhh.java

219 lines
6.3 KiB
Java

package o;
import java.util.AbstractList;
import java.util.Arrays;
import java.util.Collection;
import java.util.RandomAccess;
import o.oZe;
/* loaded from: classes2.dex */
final class Yhh extends kOJ<Float> implements oZe.ojQ, RandomAccess, vjv {
private float[] a;
private int c;
@Override // o.kOJ, java.util.AbstractList, java.util.List
public final /* synthetic */ void add(int i, Object obj) {
int i2;
float floatValue = ((Float) obj).floatValue();
c();
if (i >= 0 && i <= (i2 = this.c)) {
float[] fArr = this.a;
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.a, i, fArr2, i + 1, this.c - i);
this.a = fArr2;
}
this.a[i] = floatValue;
this.c++;
((AbstractList) this).modCount++;
return;
}
StringBuilder sb = new StringBuilder("Index:");
sb.append(i);
sb.append(", Size:");
sb.append(this.c);
throw new IndexOutOfBoundsException(sb.toString());
}
@Override // o.kOJ, java.util.AbstractList, java.util.AbstractCollection, java.util.Collection, java.util.List
public final /* synthetic */ boolean add(Object obj) {
a(((Float) obj).floatValue());
return true;
}
@Override // o.kOJ, java.util.AbstractList, java.util.List
public final /* synthetic */ Object set(int i, Object obj) {
float floatValue = ((Float) obj).floatValue();
c();
a(i);
float[] fArr = this.a;
float f = fArr[i];
fArr[i] = floatValue;
return Float.valueOf(f);
}
static {
new Yhh(new float[0], 0).d();
}
Yhh() {
this(new float[10], 0);
}
private Yhh(float[] fArr, int i) {
this.a = fArr;
this.c = i;
}
@Override // java.util.AbstractList
protected final void removeRange(int i, int i2) {
c();
if (i2 < i) {
throw new IndexOutOfBoundsException("toIndex < fromIndex");
}
float[] fArr = this.a;
System.arraycopy(fArr, i2, fArr, i, this.c - i2);
this.c -= i2 - i;
((AbstractList) this).modCount++;
}
@Override // o.kOJ, java.util.AbstractList, java.util.Collection, java.util.List
public final boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof Yhh)) {
return super.equals(obj);
}
Yhh yhh = (Yhh) obj;
if (this.c != yhh.c) {
return false;
}
float[] fArr = yhh.a;
for (int i = 0; i < this.c; i++) {
if (Float.floatToIntBits(this.a[i]) != Float.floatToIntBits(fArr[i])) {
return false;
}
}
return true;
}
@Override // o.kOJ, 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.a[i2]);
}
return i;
}
@Override // o.oZe.tOB, o.oZe.jbe
/* renamed from: e */
public final oZe.ojQ c(int i) {
if (i < this.c) {
throw new IllegalArgumentException();
}
return new Yhh(Arrays.copyOf(this.a, i), this.c);
}
@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 size = size();
for (int i = 0; i < size; i++) {
if (this.a[i] == floatValue) {
return i;
}
}
return -1;
}
@Override // java.util.AbstractCollection, java.util.Collection, java.util.List
public final boolean contains(Object obj) {
return indexOf(obj) != -1;
}
public final void a(float f) {
c();
int i = this.c;
float[] fArr = this.a;
if (i == fArr.length) {
float[] fArr2 = new float[((i * 3) / 2) + 1];
System.arraycopy(fArr, 0, fArr2, 0, i);
this.a = fArr2;
}
float[] fArr3 = this.a;
int i2 = this.c;
this.c = i2 + 1;
fArr3[i2] = f;
}
@Override // o.kOJ, java.util.AbstractCollection, java.util.Collection, java.util.List
public final boolean addAll(Collection<? extends Float> collection) {
c();
oZe.c(collection);
if (!(collection instanceof Yhh)) {
return super.addAll(collection);
}
Yhh yhh = (Yhh) collection;
int i = yhh.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.a;
if (i3 > fArr.length) {
this.a = Arrays.copyOf(fArr, i3);
}
System.arraycopy(yhh.a, 0, this.a, this.c, yhh.c);
this.c = i3;
((AbstractList) this).modCount++;
return true;
}
private void a(int i) {
if (i < 0 || i >= this.c) {
StringBuilder sb = new StringBuilder("Index:");
sb.append(i);
sb.append(", Size:");
sb.append(this.c);
throw new IndexOutOfBoundsException(sb.toString());
}
}
@Override // java.util.AbstractList, java.util.List
public final /* synthetic */ Object get(int i) {
a(i);
return Float.valueOf(this.a[i]);
}
@Override // o.kOJ, java.util.AbstractList, java.util.List
public final /* synthetic */ Object remove(int i) {
c();
a(i);
float[] fArr = this.a;
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 // java.util.AbstractCollection, java.util.Collection, java.util.List
public final int size() {
return this.c;
}
}