package defpackage;

import android.util.LongSparseArray;
import android.view.View;
import android.view.ViewGroup;
import java.util.Iterator;
import java.util.NoSuchElementException;

/* JADX INFO: renamed from: ᵠᵚˀᵫ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public class C3158 implements Iterator, InterfaceC5238 {

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public final /* synthetic */ int f12015;

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public final Object f12016;

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public int f12017;

    public /* synthetic */ C3158(int i, Object obj) {
        this.f12015 = i;
        this.f12016 = obj;
    }

    @Override // java.util.Iterator
    public final boolean hasNext() {
        int i = this.f12015;
        Object obj = this.f12016;
        switch (i) {
            case 0:
                if (this.f12017 < ((AbstractC3327) obj).mo2197()) {
                }
                break;
            case 1:
                if (this.f12017 < ((Object[]) obj).length) {
                }
                break;
            case 2:
                if (this.f12017 < ((LongSparseArray) obj).size()) {
                }
                break;
            default:
                if (this.f12017 < ((ViewGroup) obj).getChildCount()) {
                }
                break;
        }
        return true;
    }

    @Override // java.util.Iterator
    public final Object next() {
        int i = this.f12015;
        Object obj = this.f12016;
        switch (i) {
            case 0:
                if (!hasNext()) {
                    C4468.m9518();
                    return null;
                }
                int i2 = this.f12017;
                this.f12017 = i2 + 1;
                return ((AbstractC3327) obj).get(i2);
            case 1:
                try {
                    int i3 = this.f12017;
                    this.f12017 = i3 + 1;
                    return ((Object[]) obj)[i3];
                } catch (ArrayIndexOutOfBoundsException e) {
                    this.f12017--;
                    throw new NoSuchElementException(e.getMessage());
                }
            case 2:
                int i4 = this.f12017;
                this.f12017 = i4 + 1;
                return Long.valueOf(((LongSparseArray) obj).keyAt(i4));
            default:
                int i5 = this.f12017;
                this.f12017 = i5 + 1;
                View childAt = ((ViewGroup) obj).getChildAt(i5);
                if (childAt != null) {
                    return childAt;
                }
                C4468.m9514();
                return null;
        }
    }

    @Override // java.util.Iterator
    public final void remove() {
        switch (this.f12015) {
            case 0:
                throw new UnsupportedOperationException("Operation is not supported for read-only collection");
            case 1:
                throw new UnsupportedOperationException("Operation is not supported for read-only collection");
            case 2:
                throw new UnsupportedOperationException("Operation is not supported for read-only collection");
            default:
                ViewGroup viewGroup = (ViewGroup) this.f12016;
                int i = this.f12017 - 1;
                this.f12017 = i;
                viewGroup.removeViewAt(i);
                return;
        }
    }
}
