package defpackage;

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: ᵕˁːᵚ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public class C2304 extends AbstractCollection {

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

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public final Object f9065;

    public /* synthetic */ C2304(int i, Object obj) {
        this.f9064 = i;
        this.f9065 = obj;
    }

    public C2304(AbstractMap abstractMap) {
        this.f9064 = 3;
        this.f9065 = abstractMap;
    }

    @Override // java.util.AbstractCollection, java.util.Collection
    public final void clear() {
        int i = this.f9064;
        Object obj = this.f9065;
        switch (i) {
            case 0:
                ((AbstractC0833) obj).clear();
                break;
            case 1:
                ((C3156) obj).clear();
                break;
            case 2:
                ((C4072) obj).clear();
                break;
            default:
                ((AbstractMap) obj).clear();
                break;
        }
    }

    @Override // java.util.AbstractCollection, java.util.Collection
    public boolean contains(Object obj) {
        int i = this.f9064;
        Object obj2 = this.f9065;
        switch (i) {
            case 0:
                if (!(obj instanceof Map.Entry)) {
                    return false;
                }
                Map.Entry entry = (Map.Entry) obj;
                Object key = entry.getKey();
                Object value = entry.getValue();
                Collection collection = (Collection) ((AbstractC0833) obj2).mo2969().get(key);
                return collection != null && collection.contains(value);
            case 1:
                return ((C3156) obj2).mo2970(obj);
            case 2:
            default:
                return super.contains(obj);
            case 3:
                return ((AbstractMap) obj2).containsValue(obj);
        }
    }

    @Override // java.util.AbstractCollection, java.util.Collection
    public boolean isEmpty() {
        switch (this.f9064) {
            case 3:
                return ((AbstractMap) this.f9065).isEmpty();
            default:
                return super.isEmpty();
        }
    }

    @Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable
    public final Iterator iterator() {
        int i = this.f9064;
        Object obj = this.f9065;
        switch (i) {
            case 0:
                return ((AbstractC0833) obj).mo2973();
            case 1:
                return new C1299((C3156) obj, 0);
            case 2:
                C4072 c4072 = (C4072) obj;
                Map mapM8932 = c4072.m8932();
                return mapM8932 != null ? mapM8932.values().iterator() : new C3766(c4072, 2);
            default:
                return new C0108(((AbstractMap) obj).entrySet().iterator());
        }
    }

    @Override // java.util.AbstractCollection, java.util.Collection
    public boolean remove(Object obj) {
        int i = this.f9064;
        Object obj2 = this.f9065;
        switch (i) {
            case 0:
                if (!(obj instanceof Map.Entry)) {
                    return false;
                }
                Map.Entry entry = (Map.Entry) obj;
                return ((AbstractC0833) obj2).remove(entry.getKey(), entry.getValue());
            case 1:
            case 2:
            default:
                return super.remove(obj);
            case 3:
                AbstractMap abstractMap = (AbstractMap) obj2;
                try {
                    return super.remove(obj);
                } catch (UnsupportedOperationException unused) {
                    for (Map.Entry entry2 : abstractMap.entrySet()) {
                        if (ᵥˇᵛˎ.ˏːˆ(obj, entry2.getValue())) {
                            abstractMap.remove(entry2.getKey());
                            return true;
                        }
                    }
                    return false;
                }
        }
    }

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

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

    @Override // java.util.AbstractCollection, java.util.Collection
    public final int size() {
        int i = this.f9064;
        Object obj = this.f9065;
        switch (i) {
            case 0:
                return ((AbstractC0833) obj).size();
            case 1:
                return ((C3156) obj).f12014;
            case 2:
                return ((C4072) obj).size();
            default:
                return ((AbstractMap) obj).size();
        }
    }
}
