package n;

import o.AbstractC2628a;

/* JADX INFO: loaded from: classes.dex */
public abstract class U {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public Object[] f21376a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public int f21377b;

    public final Object a() {
        if (!d()) {
            return this.f21376a[0];
        }
        AbstractC2628a.e("ObjectList is empty.");
        throw null;
    }

    public final Object b(int i6) {
        if (i6 >= 0 && i6 < this.f21377b) {
            return this.f21376a[i6];
        }
        f(i6);
        throw null;
    }

    public final int c(Object obj) {
        int i6 = 0;
        if (obj == null) {
            Object[] objArr = this.f21376a;
            int i7 = this.f21377b;
            while (i6 < i7) {
                if (objArr[i6] == null) {
                    return i6;
                }
                i6++;
            }
            return -1;
        }
        Object[] objArr2 = this.f21376a;
        int i8 = this.f21377b;
        while (i6 < i8) {
            if (obj.equals(objArr2[i6])) {
                return i6;
            }
            i6++;
        }
        return -1;
    }

    public final boolean d() {
        return this.f21377b == 0;
    }

    public final boolean e() {
        return this.f21377b != 0;
    }

    public final boolean equals(Object obj) {
        if (obj instanceof U) {
            U u6 = (U) obj;
            int i6 = u6.f21377b;
            int i7 = this.f21377b;
            if (i6 == i7) {
                Object[] objArr = this.f21376a;
                Object[] objArr2 = u6.f21376a;
                P4.g gVarL0 = L4.a.l0(0, i7);
                int i8 = gVarL0.f5676a;
                int i9 = gVarL0.f5677b;
                if (i8 > i9) {
                    return true;
                }
                while (kotlin.jvm.internal.o.c(objArr[i8], objArr2[i8])) {
                    if (i8 == i9) {
                        return true;
                    }
                    i8++;
                }
                return false;
            }
        }
        return false;
    }

    public final void f(int i6) {
        StringBuilder sbR = com.google.android.recaptcha.internal.a.r(i6, "Index ", " must be in 0..");
        sbR.append(this.f21377b - 1);
        AbstractC2628a.d(sbR.toString());
        throw null;
    }

    public final int hashCode() {
        Object[] objArr = this.f21376a;
        int i6 = this.f21377b;
        int iHashCode = 0;
        for (int i7 = 0; i7 < i6; i7++) {
            Object obj = objArr[i7];
            iHashCode += (obj != null ? obj.hashCode() : 0) * 31;
        }
        return iHashCode;
    }

    public final String toString() {
        C0.Z z6 = new C0.Z(this, 24);
        StringBuilder sb = new StringBuilder("[");
        Object[] objArr = this.f21376a;
        int i6 = this.f21377b;
        int i7 = 0;
        while (true) {
            if (i7 >= i6) {
                sb.append((CharSequence) "]");
                break;
            }
            Object obj = objArr[i7];
            if (i7 == -1) {
                sb.append((CharSequence) "...");
                break;
            }
            if (i7 != 0) {
                sb.append((CharSequence) ", ");
            }
            sb.append((CharSequence) z6.invoke(obj));
            i7++;
        }
        String string = sb.toString();
        kotlin.jvm.internal.o.g(string, "toString(...)");
        return string;
    }
}
