package o;

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

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class O extends N implements ListIterator {

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

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public O(Q q, int i) {
        super(0, q);
        this.f262o = q;
        int iA = q.a();
        if (i < 0 || i > iA) {
            throw new IndexOutOfBoundsException(AbstractC0126Ew.i(i, iA, "index: ", ", size: "));
        }
        this.m = i;
    }

    @Override // java.util.ListIterator
    public final void add(Object obj) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

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

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

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

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

    @Override // java.util.ListIterator
    public final void set(Object obj) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }
}
