package o;

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

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.k9, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C1649k9 implements Iterator, Map.Entry {
    public int l;
    public int m = -1;
    public boolean n;

    /* renamed from: o, reason: collision with root package name */
    public final /* synthetic */ C1839m9 f607o;

    public C1649k9(C1839m9 c1839m9) {
        this.f607o = c1839m9;
        this.l = c1839m9.n - 1;
    }

    @Override // java.util.Map.Entry
    public final boolean equals(Object obj) {
        if (!this.n) {
            throw new IllegalStateException("This container does not support retaining Map.Entry objects");
        }
        if (!(obj instanceof Map.Entry)) {
            return false;
        }
        Map.Entry entry = (Map.Entry) obj;
        Object key = entry.getKey();
        int i = this.m;
        C1839m9 c1839m9 = this.f607o;
        return F3.c(key, c1839m9.f(i)) && F3.c(entry.getValue(), c1839m9.i(this.m));
    }

    @Override // java.util.Map.Entry
    public final Object getKey() {
        if (this.n) {
            return this.f607o.f(this.m);
        }
        throw new IllegalStateException("This container does not support retaining Map.Entry objects");
    }

    @Override // java.util.Map.Entry
    public final Object getValue() {
        if (this.n) {
            return this.f607o.i(this.m);
        }
        throw new IllegalStateException("This container does not support retaining Map.Entry objects");
    }

    @Override // java.util.Iterator
    public final boolean hasNext() {
        return this.m < this.l;
    }

    @Override // java.util.Map.Entry
    public final int hashCode() {
        if (!this.n) {
            throw new IllegalStateException("This container does not support retaining Map.Entry objects");
        }
        int i = this.m;
        C1839m9 c1839m9 = this.f607o;
        Object objF = c1839m9.f(i);
        Object objI = c1839m9.i(this.m);
        return (objF == null ? 0 : objF.hashCode()) ^ (objI != null ? objI.hashCode() : 0);
    }

    @Override // java.util.Iterator
    public final Object next() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        this.m++;
        this.n = true;
        return this;
    }

    @Override // java.util.Iterator
    public final void remove() {
        if (!this.n) {
            throw new IllegalStateException();
        }
        this.f607o.g(this.m);
        this.m--;
        this.l--;
        this.n = false;
    }

    @Override // java.util.Map.Entry
    public final Object setValue(Object obj) {
        if (this.n) {
            return this.f607o.h(this.m, obj);
        }
        throw new IllegalStateException("This container does not support retaining Map.Entry objects");
    }

    public final String toString() {
        return getKey() + "=" + getValue();
    }
}
