package F3;

import java.util.AbstractCollection;
import java.util.AbstractMap;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;

/* JADX INFO: renamed from: F3.y, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes3.dex */
public final class C0224y extends AbstractCollection {

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

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

    public C0224y(C0225z c0225z) {
        this.f1630b = c0225z;
    }

    @Override // java.util.AbstractCollection, java.util.Collection
    public final void clear() {
        switch (this.f1629a) {
            case 0:
                ((C0225z) this.f1630b).clear();
                break;
            default:
                ((C0206f) this.f1630b).clear();
                break;
        }
    }

    @Override // java.util.AbstractCollection, java.util.Collection
    public boolean contains(Object obj) {
        switch (this.f1629a) {
            case 1:
                return ((C0206f) this.f1630b).containsValue(obj);
            default:
                return super.contains(obj);
        }
    }

    @Override // java.util.AbstractCollection, java.util.Collection
    public boolean isEmpty() {
        switch (this.f1629a) {
            case 1:
                return ((C0206f) this.f1630b).isEmpty();
            default:
                return super.isEmpty();
        }
    }

    @Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable
    public final Iterator iterator() {
        switch (this.f1629a) {
            case 0:
                C0225z c0225z = (C0225z) this.f1630b;
                Map mapB = c0225z.b();
                return mapB != null ? mapB.values().iterator() : new C0221v(c0225z, 2);
            default:
                return new i0(((C0206f) this.f1630b).entrySet().iterator(), 1);
        }
    }

    @Override // java.util.AbstractCollection, java.util.Collection
    public boolean remove(Object obj) {
        switch (this.f1629a) {
            case 1:
                try {
                    return super.remove(obj);
                } catch (UnsupportedOperationException unused) {
                    C0206f c0206f = (C0206f) this.f1630b;
                    for (Map.Entry entry : c0206f.entrySet()) {
                        if (android.support.v4.media.session.b.n(obj, entry.getValue())) {
                            c0206f.remove(entry.getKey());
                            return true;
                        }
                    }
                    return false;
                }
            default:
                return super.remove(obj);
        }
    }

    @Override // java.util.AbstractCollection, java.util.Collection
    public boolean removeAll(Collection collection) {
        switch (this.f1629a) {
            case 1:
                try {
                    collection.getClass();
                    return super.removeAll(collection);
                } catch (UnsupportedOperationException unused) {
                    HashSet hashSet = new HashSet();
                    C0206f c0206f = (C0206f) this.f1630b;
                    for (Map.Entry entry : c0206f.entrySet()) {
                        if (collection.contains(entry.getValue())) {
                            hashSet.add(entry.getKey());
                        }
                    }
                    return c0206f.keySet().removeAll(hashSet);
                }
            default:
                return super.removeAll(collection);
        }
    }

    @Override // java.util.AbstractCollection, java.util.Collection
    public boolean retainAll(Collection collection) {
        switch (this.f1629a) {
            case 1:
                try {
                    collection.getClass();
                    return super.retainAll(collection);
                } catch (UnsupportedOperationException unused) {
                    HashSet hashSet = new HashSet();
                    C0206f c0206f = (C0206f) this.f1630b;
                    for (Map.Entry entry : c0206f.entrySet()) {
                        if (collection.contains(entry.getValue())) {
                            hashSet.add(entry.getKey());
                        }
                    }
                    return c0206f.keySet().retainAll(hashSet);
                }
            default:
                return super.retainAll(collection);
        }
    }

    @Override // java.util.AbstractCollection, java.util.Collection
    public final int size() {
        switch (this.f1629a) {
            case 0:
                return ((C0225z) this.f1630b).size();
            default:
                return ((C0206f) this.f1630b).f1556c.size();
        }
    }

    public C0224y(C0206f c0206f) {
        this.f1630b = c0206f;
    }
}
