package q1;

import Z0.o;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Objects;
import q.AbstractC2761L;

/* JADX INFO: renamed from: q1.b, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public abstract class AbstractC2830b extends AbstractC2831c {

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public ArrayList f23578e;

    public AbstractC2830b(char[] cArr) {
        super(cArr);
        this.f23578e = new ArrayList();
    }

    public final boolean A(String str) {
        for (AbstractC2831c abstractC2831c : this.f23578e) {
            if ((abstractC2831c instanceof C2832d) && ((C2832d) abstractC2831c).h().equals(str)) {
                return true;
            }
        }
        return false;
    }

    public final ArrayList B() {
        ArrayList arrayList = new ArrayList();
        for (AbstractC2831c abstractC2831c : this.f23578e) {
            if (abstractC2831c instanceof C2832d) {
                arrayList.add(((C2832d) abstractC2831c).h());
            }
        }
        return arrayList;
    }

    public final void C(String str, AbstractC2831c abstractC2831c) {
        Iterator it = this.f23578e.iterator();
        while (it.hasNext()) {
            C2832d c2832d = (C2832d) ((AbstractC2831c) it.next());
            if (c2832d.h().equals(str)) {
                if (c2832d.f23578e.size() > 0) {
                    c2832d.f23578e.set(0, abstractC2831c);
                    return;
                } else {
                    c2832d.f23578e.add(abstractC2831c);
                    return;
                }
            }
        }
        C2832d c2832d2 = new C2832d(str.toCharArray());
        c2832d2.f23580b = 0L;
        c2832d2.m(str.length() - 1);
        if (c2832d2.f23578e.size() > 0) {
            c2832d2.f23578e.set(0, abstractC2831c);
        } else {
            c2832d2.f23578e.add(abstractC2831c);
        }
        this.f23578e.add(c2832d2);
    }

    public final void D(String str, String str2) {
        C2837i c2837i = new C2837i(str2.toCharArray());
        c2837i.f23580b = 0L;
        c2837i.m(str2.length() - 1);
        C(str, c2837i);
    }

    @Override // q1.AbstractC2831c
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj instanceof AbstractC2830b) {
            return this.f23578e.equals(((AbstractC2830b) obj).f23578e);
        }
        return false;
    }

    @Override // q1.AbstractC2831c
    public int hashCode() {
        return Objects.hash(this.f23578e, Integer.valueOf(super.hashCode()));
    }

    public final void n(AbstractC2831c abstractC2831c) {
        this.f23578e.add(abstractC2831c);
    }

    @Override // q1.AbstractC2831c
    /* JADX INFO: renamed from: o, reason: merged with bridge method [inline-methods] */
    public AbstractC2830b clone() {
        AbstractC2830b abstractC2830b = (AbstractC2830b) super.clone();
        ArrayList arrayList = new ArrayList(this.f23578e.size());
        Iterator it = this.f23578e.iterator();
        while (it.hasNext()) {
            AbstractC2831c abstractC2831cClone = ((AbstractC2831c) it.next()).clone();
            abstractC2831cClone.f23582d = abstractC2830b;
            arrayList.add(abstractC2831cClone);
        }
        abstractC2830b.f23578e = arrayList;
        return abstractC2830b;
    }

    public final AbstractC2831c p(int i6) throws C2836h {
        if (i6 < 0 || i6 >= this.f23578e.size()) {
            throw new C2836h(o.l("no element at index ", i6), this);
        }
        return (AbstractC2831c) this.f23578e.get(i6);
    }

    public final AbstractC2831c q(String str) throws C2836h {
        Iterator it = this.f23578e.iterator();
        while (it.hasNext()) {
            C2832d c2832d = (C2832d) ((AbstractC2831c) it.next());
            if (c2832d.h().equals(str)) {
                if (c2832d.f23578e.size() > 0) {
                    return (AbstractC2831c) c2832d.f23578e.get(0);
                }
                return null;
            }
        }
        throw new C2836h(o.o("no element for key <", str, ">"), this);
    }

    public final float r(int i6) throws C2836h {
        AbstractC2831c abstractC2831cP = p(i6);
        if (abstractC2831cP != null) {
            return abstractC2831cP.j();
        }
        throw new C2836h(o.l("no float at index ", i6), this);
    }

    public final float s(String str) throws C2836h {
        AbstractC2831c abstractC2831cQ = q(str);
        if (abstractC2831cQ != null) {
            return abstractC2831cQ.j();
        }
        StringBuilder sbS = com.google.android.recaptcha.internal.a.s("no float found for key <", str, ">, found [");
        sbS.append(abstractC2831cQ.l());
        sbS.append("] : ");
        sbS.append(abstractC2831cQ);
        throw new C2836h(sbS.toString(), this);
    }

    @Override // q1.AbstractC2831c
    public final String toString() {
        StringBuilder sb = new StringBuilder();
        for (AbstractC2831c abstractC2831c : this.f23578e) {
            if (sb.length() > 0) {
                sb.append("; ");
            }
            sb.append(abstractC2831c);
        }
        return super.toString() + " = <" + ((Object) sb) + " >";
    }

    public final int u(int i6) throws C2836h {
        AbstractC2831c abstractC2831cP = p(i6);
        if (abstractC2831cP != null) {
            return abstractC2831cP.k();
        }
        throw new C2836h(o.l("no int at index ", i6), this);
    }

    public final AbstractC2831c v(int i6) {
        if (i6 < 0 || i6 >= this.f23578e.size()) {
            return null;
        }
        return (AbstractC2831c) this.f23578e.get(i6);
    }

    public final AbstractC2831c w(String str) {
        Iterator it = this.f23578e.iterator();
        while (true) {
            if (!it.hasNext()) {
                break;
            }
            C2832d c2832d = (C2832d) ((AbstractC2831c) it.next());
            if (c2832d.h().equals(str)) {
                if (c2832d.f23578e.size() > 0) {
                    return (AbstractC2831c) c2832d.f23578e.get(0);
                }
            }
        }
        return null;
    }

    public final String x(int i6) throws C2836h {
        AbstractC2831c abstractC2831cP = p(i6);
        if (abstractC2831cP instanceof C2837i) {
            return abstractC2831cP.h();
        }
        throw new C2836h(o.l("no string at index ", i6), this);
    }

    public final String y(String str) throws C2836h {
        AbstractC2831c abstractC2831cQ = q(str);
        if (abstractC2831cQ instanceof C2837i) {
            return abstractC2831cQ.h();
        }
        StringBuilder sbI = AbstractC2761L.i("no string found for key <", str, ">, found [", abstractC2831cQ != null ? abstractC2831cQ.l() : null, "] : ");
        sbI.append(abstractC2831cQ);
        throw new C2836h(sbI.toString(), this);
    }

    public final String z(String str) {
        AbstractC2831c abstractC2831cW = w(str);
        if (abstractC2831cW instanceof C2837i) {
            return abstractC2831cW.h();
        }
        return null;
    }
}
