package defpackage;

import java.util.AbstractList;
import java.util.Arrays;
import java.util.List;
import java.util.RandomAccess;

/* JADX INFO: renamed from: ᵸᵼˊᵙ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C5024 extends AbstractC3278 implements RandomAccess {

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public static final Object[] f19043;

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public static final C5024 f19044;

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public int f19045;

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public Object[] f19046;

    static {
        Object[] objArr = new Object[0];
        f19043 = objArr;
        f19044 = new C5024(objArr, 0, false);
    }

    public C5024(Object[] objArr, int i, boolean z) {
        super(z);
        this.f19046 = objArr;
        this.f19045 = i;
    }

    @Override // java.util.AbstractList, java.util.List
    public final void add(int i, Object obj) {
        int i2;
        m7512();
        if (i < 0 || i > (i2 = this.f19045)) {
            C1390.m3982(C4449.m9468(this.f19045, i, (byte) 13, "Index:", ", Size:"));
            return;
        }
        int i3 = i + 1;
        Object[] objArr = this.f19046;
        int length = objArr.length;
        if (i2 < length) {
            System.arraycopy(objArr, i, objArr, i3, i2 - i);
        } else {
            Object[] objArr2 = new Object[AbstractC0659.m2408(length, 3, 2, 1, 10)];
            System.arraycopy(this.f19046, 0, objArr2, 0, i);
            System.arraycopy(this.f19046, i, objArr2, i3, this.f19045 - i);
            this.f19046 = objArr2;
        }
        this.f19046[i] = obj;
        this.f19045++;
        ((AbstractList) this).modCount++;
    }

    @Override // java.util.AbstractList, java.util.AbstractCollection, java.util.Collection, java.util.List
    public final boolean add(Object obj) {
        m7512();
        int i = this.f19045;
        int length = this.f19046.length;
        if (i == length) {
            this.f19046 = Arrays.copyOf(this.f19046, AbstractC0659.m2408(length, 3, 2, 1, 10));
        }
        Object[] objArr = this.f19046;
        int i2 = this.f19045;
        this.f19045 = i2 + 1;
        objArr[i2] = obj;
        ((AbstractList) this).modCount++;
        return true;
    }

    @Override // defpackage.AbstractC3278, java.util.AbstractList, java.util.Collection, java.util.List
    public final boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof List)) {
            return false;
        }
        if (!(obj instanceof RandomAccess)) {
            return super.equals(obj);
        }
        List list = (List) obj;
        int i = this.f19045;
        if (i != list.size()) {
            return false;
        }
        if (!(obj instanceof C5024)) {
            for (int i2 = 0; i2 < i; i2++) {
                if (!this.f19046[i2].equals(list.get(i2))) {
                    return false;
                }
            }
            return true;
        }
        C5024 c5024 = (C5024) obj;
        for (int i3 = 0; i3 < i; i3++) {
            if (!this.f19046[i3].equals(c5024.f19046[i3])) {
                return false;
            }
        }
        return true;
    }

    @Override // java.util.AbstractList, java.util.List
    public final Object get(int i) {
        m10367(i);
        return this.f19046[i];
    }

    @Override // java.util.AbstractList, java.util.Collection, java.util.List
    public final int hashCode() {
        int i = this.f19045;
        int iHashCode = 1;
        for (int i2 = 0; i2 < i; i2++) {
            iHashCode = (iHashCode * 31) + this.f19046[i2].hashCode();
        }
        return iHashCode;
    }

    @Override // defpackage.AbstractC3278, java.util.AbstractList, java.util.List
    public final Object remove(int i) {
        m7512();
        m10367(i);
        Object[] objArr = this.f19046;
        Object obj = objArr[i];
        if (i < this.f19045 - 1) {
            System.arraycopy(objArr, i + 1, objArr, i, (r2 - i) - 1);
        }
        this.f19045--;
        ((AbstractList) this).modCount++;
        return obj;
    }

    @Override // java.util.AbstractList, java.util.List
    public final Object set(int i, Object obj) {
        m7512();
        m10367(i);
        Object[] objArr = this.f19046;
        Object obj2 = objArr[i];
        objArr[i] = obj;
        ((AbstractList) this).modCount++;
        return obj2;
    }

    @Override // java.util.AbstractCollection, java.util.Collection, java.util.List
    public final int size() {
        return this.f19045;
    }

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final void m10367(int i) {
        if (i < 0 || i >= this.f19045) {
            C1390.m3982(C4449.m9468(this.f19045, i, (byte) 13, "Index:", ", Size:"));
        }
    }

    @Override // defpackage.InterfaceC1603
    /* JADX INFO: renamed from: ᵱʡˏ */
    public final /* bridge */ /* synthetic */ InterfaceC1603 mo4452(int i) {
        if (i >= this.f19045) {
            return new C5024(i == 0 ? f19043 : Arrays.copyOf(this.f19046, i), this.f19045, true);
        }
        ᵷᵝˎ.ᵷᵺʾᵖ();
        return null;
    }
}
