package q;

import androidx.datastore.preferences.protobuf.Z;
import java.util.Arrays;
import java.util.Collection;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/* JADX INFO: loaded from: classes.dex */
public final class e extends i implements Map {

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public Z f16176t;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public C1441b f16177u;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public C1443d f16178v;

    public e() {
        super(0);
    }

    @Override // java.util.Map
    public final Set entrySet() {
        Z z8 = this.f16176t;
        if (z8 != null) {
            return z8;
        }
        Z z9 = new Z(this, 1);
        this.f16176t = z9;
        return z9;
    }

    public final boolean i(Collection collection) {
        Iterator it = collection.iterator();
        while (it.hasNext()) {
            if (!super.containsKey(it.next())) {
                return false;
            }
        }
        return true;
    }

    public final boolean j(Collection collection) {
        int i = this.f16190s;
        Iterator it = collection.iterator();
        while (it.hasNext()) {
            super.remove(it.next());
        }
        return i != this.f16190s;
    }

    @Override // java.util.Map
    public final Set keySet() {
        C1441b c1441b = this.f16177u;
        if (c1441b != null) {
            return c1441b;
        }
        C1441b c1441b2 = new C1441b(this);
        this.f16177u = c1441b2;
        return c1441b2;
    }

    @Override // java.util.Map
    public final void putAll(Map map) {
        int size = map.size() + this.f16190s;
        int i = this.f16190s;
        int[] iArr = this.f16188q;
        if (iArr.length < size) {
            int[] iArrCopyOf = Arrays.copyOf(iArr, size);
            P6.g.d(iArrCopyOf, "copyOf(this, newSize)");
            this.f16188q = iArrCopyOf;
            Object[] objArrCopyOf = Arrays.copyOf(this.f16189r, size * 2);
            P6.g.d(objArrCopyOf, "copyOf(this, newSize)");
            this.f16189r = objArrCopyOf;
        }
        if (this.f16190s != i) {
            throw new ConcurrentModificationException();
        }
        for (Map.Entry entry : map.entrySet()) {
            put(entry.getKey(), entry.getValue());
        }
    }

    @Override // java.util.Map
    public final Collection values() {
        C1443d c1443d = this.f16178v;
        if (c1443d != null) {
            return c1443d;
        }
        C1443d c1443d2 = new C1443d(this);
        this.f16178v = c1443d2;
        return c1443d2;
    }
}
