package kotlin.reflect.jvm.internal.impl.util;

import com.google.android.gms.measurement.api.AppMeasurementSdk;
import defpackage.cr4;
import defpackage.f25;
import defpackage.kp6;
import defpackage.pq6;
import java.util.Iterator;
import java.util.NoSuchElementException;

/* JADX INFO: loaded from: classes3.dex */
public final class OneElementArrayMap<T> extends ArrayMap<T> {
    private final int index;

    @kp6
    private final T value;

    /* JADX INFO: renamed from: kotlin.reflect.jvm.internal.impl.util.OneElementArrayMap$iterator$1, reason: invalid class name */
    public static final class AnonymousClass1 implements Iterator<T>, f25 {
        private boolean notVisited = true;
        final /* synthetic */ OneElementArrayMap<T> this$0;

        public AnonymousClass1(OneElementArrayMap<T> oneElementArrayMap) {
            this.this$0 = oneElementArrayMap;
        }

        @Override // java.util.Iterator
        public boolean hasNext() {
            return this.notVisited;
        }

        @Override // java.util.Iterator
        public T next() {
            if (!this.notVisited) {
                throw new NoSuchElementException();
            }
            this.notVisited = false;
            return this.this$0.getValue();
        }

        @Override // java.util.Iterator
        public void remove() {
            throw new UnsupportedOperationException("Operation is not supported for read-only collection");
        }
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public OneElementArrayMap(@kp6 T t, int i) {
        super(null);
        cr4.g(t, AppMeasurementSdk.ConditionalUserProperty.VALUE);
        this.value = t;
        this.index = i;
    }

    @Override // kotlin.reflect.jvm.internal.impl.util.ArrayMap
    @pq6
    public T get(int i) {
        if (i == this.index) {
            return this.value;
        }
        return null;
    }

    public final int getIndex() {
        return this.index;
    }

    @Override // kotlin.reflect.jvm.internal.impl.util.ArrayMap
    public int getSize() {
        return 1;
    }

    @kp6
    public final T getValue() {
        return this.value;
    }

    @Override // kotlin.reflect.jvm.internal.impl.util.ArrayMap, java.lang.Iterable
    @kp6
    public Iterator<T> iterator() {
        return new AnonymousClass1(this);
    }

    @Override // kotlin.reflect.jvm.internal.impl.util.ArrayMap
    public void set(int i, @kp6 T t) {
        cr4.g(t, AppMeasurementSdk.ConditionalUserProperty.VALUE);
        throw new IllegalStateException();
    }
}
