package o;

import java.util.Iterator;
import java.util.Map;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class EW extends W {
    public final /* synthetic */ int l;
    public final C3002yW m;

    public /* synthetic */ EW(int i, C3002yW c3002yW) {
        this.l = i;
        this.m = c3002yW;
    }

    @Override // o.W
    public final int a() {
        switch (this.l) {
            case 0:
                C3002yW c3002yW = this.m;
                c3002yW.getClass();
                return c3002yW.p;
            default:
                C3002yW c3002yW2 = this.m;
                c3002yW2.getClass();
                return c3002yW2.p;
        }
    }

    @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
    public final boolean add(Object obj) {
        switch (this.l) {
            case 0:
                throw new UnsupportedOperationException();
            default:
                throw new UnsupportedOperationException();
        }
    }

    @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
    public final void clear() {
        switch (this.l) {
            case 0:
                this.m.clear();
                break;
            default:
                this.m.clear();
                break;
        }
    }

    @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
    public final boolean contains(Object obj) {
        switch (this.l) {
            case 0:
                if (!(obj instanceof Map.Entry)) {
                    return false;
                }
                Map.Entry entry = (Map.Entry) obj;
                Object key = entry.getKey();
                C3002yW c3002yW = this.m;
                Object obj2 = c3002yW.get(key);
                return obj2 != null ? obj2.equals(entry.getValue()) : entry.getValue() == null && c3002yW.containsKey(entry.getKey());
            default:
                return this.m.containsKey(obj);
        }
    }

    @Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set
    public final Iterator iterator() {
        switch (this.l) {
            case 0:
                return new FW(this.m);
            default:
                AbstractC0833bh0[] abstractC0833bh0Arr = new AbstractC0833bh0[8];
                for (int i = 0; i < 8; i++) {
                    abstractC0833bh0Arr[i] = new C0928ch0(1);
                }
                return new GW(this.m, abstractC0833bh0Arr);
        }
    }

    @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set
    public final boolean remove(Object obj) {
        switch (this.l) {
            case 0:
                if (!(obj instanceof Map.Entry)) {
                    return false;
                }
                Map.Entry entry = (Map.Entry) obj;
                return this.m.remove(entry.getKey(), entry.getValue());
            default:
                C3002yW c3002yW = this.m;
                if (!c3002yW.containsKey(obj)) {
                    return false;
                }
                c3002yW.remove(obj);
                return true;
        }
    }
}
