package F3;

import java.util.Collection;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;

/* JADX INFO: renamed from: F3.e, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes3.dex */
public class C0205e implements Iterator {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f1550a = 0;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final Iterator f1551b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public Object f1552c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ Object f1553d;

    public C0205e(C0214n c0214n) {
        this.f1553d = c0214n;
        Collection collection = c0214n.f1576b;
        this.f1552c = collection;
        this.f1551b = collection instanceof List ? ((List) collection).listIterator() : collection.iterator();
    }

    public void a() {
        C0214n c0214n = (C0214n) this.f1553d;
        c0214n.g();
        if (c0214n.f1576b != ((Collection) this.f1552c)) {
            throw new ConcurrentModificationException();
        }
    }

    @Override // java.util.Iterator
    public final boolean hasNext() {
        switch (this.f1550a) {
            case 0:
                break;
            case 1:
                break;
            default:
                a();
                break;
        }
        return this.f1551b.hasNext();
    }

    @Override // java.util.Iterator
    public final Object next() {
        switch (this.f1550a) {
            case 0:
                Map.Entry entry = (Map.Entry) this.f1551b.next();
                this.f1552c = (Collection) entry.getValue();
                return ((C0206f) this.f1553d).a(entry);
            case 1:
                Map.Entry entry2 = (Map.Entry) this.f1551b.next();
                this.f1552c = entry2;
                return entry2.getKey();
            default:
                a();
                return this.f1551b.next();
        }
    }

    @Override // java.util.Iterator
    public final void remove() {
        switch (this.f1550a) {
            case 0:
                A4.g.t(((Collection) this.f1552c) != null, "no calls to next() since the last call to remove()");
                this.f1551b.remove();
                C0206f c0206f = (C0206f) this.f1553d;
                c0206f.f1557d.f1536f -= ((Collection) this.f1552c).size();
                ((Collection) this.f1552c).clear();
                this.f1552c = null;
                break;
            case 1:
                A4.g.t(((Map.Entry) this.f1552c) != null, "no calls to next() since the last call to remove()");
                Collection collection = (Collection) ((Map.Entry) this.f1552c).getValue();
                this.f1551b.remove();
                C0207g c0207g = (C0207g) this.f1553d;
                c0207g.f1561b.f1536f -= collection.size();
                collection.clear();
                this.f1552c = null;
                break;
            default:
                this.f1551b.remove();
                C0214n c0214n = (C0214n) this.f1553d;
                AbstractC0199b abstractC0199b = c0214n.f1579e;
                abstractC0199b.f1536f--;
                c0214n.h();
                break;
        }
    }

    public C0205e(C0214n c0214n, ListIterator listIterator) {
        this.f1553d = c0214n;
        this.f1552c = c0214n.f1576b;
        this.f1551b = listIterator;
    }

    public C0205e(C0207g c0207g, Iterator it) {
        this.f1553d = c0207g;
        this.f1551b = it;
    }

    public C0205e(C0206f c0206f) {
        this.f1553d = c0206f;
        this.f1551b = c0206f.f1556c.entrySet().iterator();
    }
}
