package o;

import java.util.ListIterator;
import java.util.NoSuchElementException;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class Zn0 extends Sh0 implements ListIterator {
    public final int m;
    public int n;

    /* renamed from: o, reason: collision with root package name */
    public final AbstractC1229fo0 f440o;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public Zn0(AbstractC1229fo0 abstractC1229fo0, int i) {
        super(1);
        int size = abstractC1229fo0.size();
        AbstractC2798wI.C(i, size);
        this.m = size;
        this.n = i;
        this.f440o = abstractC1229fo0;
    }

    public final Object a(int i) {
        return this.f440o.get(i);
    }

    @Override // java.util.ListIterator
    public final void add(Object obj) {
        throw new UnsupportedOperationException();
    }

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

    @Override // java.util.ListIterator
    public final boolean hasPrevious() {
        return this.n > 0;
    }

    @Override // java.util.Iterator, java.util.ListIterator
    public final Object next() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        int i = this.n;
        this.n = i + 1;
        return a(i);
    }

    @Override // java.util.ListIterator
    public final int nextIndex() {
        return this.n;
    }

    @Override // java.util.ListIterator
    public final Object previous() {
        if (!hasPrevious()) {
            throw new NoSuchElementException();
        }
        int i = this.n - 1;
        this.n = i;
        return a(i);
    }

    @Override // java.util.ListIterator
    public final int previousIndex() {
        return this.n - 1;
    }

    @Override // java.util.ListIterator
    public final void set(Object obj) {
        throw new UnsupportedOperationException();
    }
}
