package o; import java.util.AbstractList; import java.util.Arrays; import java.util.Collection; import java.util.RandomAccess; import o.MTP; /* renamed from: o.heO, reason: case insensitive filesystem */ /* loaded from: classes2.dex */ final class C15673heO extends AbstractC15969jyR implements ScT, RandomAccess, VAu { private int c; long[] d; @Override // o.AbstractC15969jyR, java.util.AbstractList, java.util.List public final /* synthetic */ void add(int i, Object obj) { int i2; long longValue = ((Long) obj).longValue(); d(); if (i >= 0 && i <= (i2 = this.c)) { long[] jArr = this.d; if (i2 < jArr.length) { System.arraycopy(jArr, i, jArr, i + 1, i2 - i); } else { long[] jArr2 = new long[((i2 * 3) / 2) + 1]; System.arraycopy(jArr, 0, jArr2, 0, i); System.arraycopy(this.d, i, jArr2, i + 1, this.c - i); this.d = jArr2; } this.d[i] = longValue; 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.AbstractC15969jyR, java.util.AbstractList, java.util.AbstractCollection, java.util.Collection, java.util.List public final /* synthetic */ boolean add(Object obj) { e(((Long) obj).longValue()); return true; } @Override // o.MTP.RVV public final /* synthetic */ MTP.RVV b(int i) { if (i < this.c) { throw new IllegalArgumentException(); } return new C15673heO(Arrays.copyOf(this.d, i), this.c); } @Override // o.AbstractC15969jyR, java.util.AbstractList, java.util.List public final /* synthetic */ Object set(int i, Object obj) { long longValue = ((Long) obj).longValue(); d(); d(i); long[] jArr = this.d; long j = jArr[i]; jArr[i] = longValue; return Long.valueOf(j); } static { new C15673heO(new long[0], 0).a(); } C15673heO() { this(new long[10], 0); } private C15673heO(long[] jArr, int i) { this.d = jArr; this.c = i; } @Override // java.util.AbstractList protected final void removeRange(int i, int i2) { d(); if (i2 < i) { throw new IndexOutOfBoundsException("toIndex < fromIndex"); } long[] jArr = this.d; System.arraycopy(jArr, i2, jArr, i, this.c - i2); this.c -= i2 - i; ((AbstractList) this).modCount++; } @Override // o.AbstractC15969jyR, java.util.AbstractList, java.util.Collection, java.util.List public final boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof C15673heO)) { return super.equals(obj); } C15673heO c15673heO = (C15673heO) obj; if (this.c != c15673heO.c) { return false; } long[] jArr = c15673heO.d; for (int i = 0; i < this.c; i++) { if (this.d[i] != jArr[i]) { return false; } } return true; } @Override // o.AbstractC15969jyR, 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) + MTP.b(this.d[i2]); } return i; } @Override // java.util.AbstractList, java.util.List public final int indexOf(Object obj) { if (!(obj instanceof Long)) { return -1; } long longValue = ((Long) obj).longValue(); int size = size(); for (int i = 0; i < size; i++) { if (this.d[i] == longValue) { 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 e(long j) { d(); int i = this.c; long[] jArr = this.d; if (i == jArr.length) { long[] jArr2 = new long[((i * 3) / 2) + 1]; System.arraycopy(jArr, 0, jArr2, 0, i); this.d = jArr2; } long[] jArr3 = this.d; int i2 = this.c; this.c = i2 + 1; jArr3[i2] = j; } @Override // o.AbstractC15969jyR, java.util.AbstractCollection, java.util.Collection, java.util.List public final boolean addAll(Collection collection) { d(); MTP.d(collection); if (!(collection instanceof C15673heO)) { return super.addAll(collection); } C15673heO c15673heO = (C15673heO) collection; int i = c15673heO.c; if (i == 0) { return false; } int i2 = this.c; if (Integer.MAX_VALUE - i2 < i) { throw new OutOfMemoryError(); } int i3 = i2 + i; long[] jArr = this.d; if (i3 > jArr.length) { this.d = Arrays.copyOf(jArr, i3); } System.arraycopy(c15673heO.d, 0, this.d, this.c, c15673heO.c); this.c = i3; ((AbstractList) this).modCount++; return true; } /* JADX INFO: Access modifiers changed from: package-private */ public final void d(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) { d(i); return Long.valueOf(this.d[i]); } @Override // o.AbstractC15969jyR, java.util.AbstractList, java.util.List public final /* synthetic */ Object remove(int i) { d(); d(i); long[] jArr = this.d; long j = jArr[i]; if (i < this.c - 1) { System.arraycopy(jArr, i + 1, jArr, i, (r3 - i) - 1); } this.c--; ((AbstractList) this).modCount++; return Long.valueOf(j); } @Override // java.util.AbstractCollection, java.util.Collection, java.util.List public final int size() { return this.c; } }