package o;

import java.util.List;
import java.util.ListIterator;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class RQ implements ListIterator, InterfaceC2989yJ {
    public final /* synthetic */ int l;
    public final Object m;
    public int n;

    public RQ(List list, int i, int i2) {
        this.l = i2;
        switch (i2) {
            case 1:
                this.m = list;
                this.n = i;
                break;
            default:
                this.m = list;
                this.n = i - 1;
                break;
        }
    }

    /* JADX WARN: Type inference failed for: r0v3, types: [java.lang.Object, java.util.List] */
    /* JADX WARN: Type inference failed for: r1v0, types: [java.lang.Object, java.util.List] */
    @Override // java.util.ListIterator
    public final void add(Object obj) {
        switch (this.l) {
            case 0:
                int i = this.n + 1;
                this.n = i;
                this.m.add(i, obj);
                break;
            default:
                this.m.add(this.n, obj);
                this.n++;
                break;
        }
    }

    /* JADX WARN: Type inference failed for: r1v0, types: [java.lang.Object, java.util.List] */
    /* JADX WARN: Type inference failed for: r1v3, types: [java.lang.Object, java.util.List] */
    @Override // java.util.ListIterator, java.util.Iterator
    public final boolean hasNext() {
        switch (this.l) {
            case 0:
                return this.n < this.m.size() - 1;
            default:
                return this.n < this.m.size();
        }
    }

    @Override // java.util.ListIterator
    public final boolean hasPrevious() {
        switch (this.l) {
            case 0:
                if (this.n >= 0) {
                }
                break;
            default:
                if (this.n > 0) {
                }
                break;
        }
        return false;
    }

    /* JADX WARN: Type inference failed for: r1v0, types: [java.lang.Object, java.util.List] */
    /* JADX WARN: Type inference failed for: r1v2, types: [java.lang.Object, java.util.List] */
    @Override // java.util.ListIterator, java.util.Iterator
    public final Object next() {
        switch (this.l) {
            case 0:
                int i = this.n + 1;
                this.n = i;
                return this.m.get(i);
            default:
                int i2 = this.n;
                this.n = i2 + 1;
                return this.m.get(i2);
        }
    }

    @Override // java.util.ListIterator
    public final int nextIndex() {
        switch (this.l) {
            case 0:
                return this.n + 1;
            default:
                return this.n;
        }
    }

    /* JADX WARN: Type inference failed for: r1v1, types: [java.lang.Object, java.util.List] */
    /* JADX WARN: Type inference failed for: r1v2, types: [java.lang.Object, java.util.List] */
    @Override // java.util.ListIterator
    public final Object previous() {
        switch (this.l) {
            case 0:
                int i = this.n;
                this.n = i - 1;
                return this.m.get(i);
            default:
                int i2 = this.n - 1;
                this.n = i2;
                return this.m.get(i2);
        }
    }

    @Override // java.util.ListIterator
    public final int previousIndex() {
        switch (this.l) {
            case 0:
                return this.n;
            default:
                return this.n - 1;
        }
    }

    /* JADX WARN: Type inference failed for: r0v1, types: [java.lang.Object, java.util.List] */
    /* JADX WARN: Type inference failed for: r1v1, types: [java.lang.Object, java.util.List] */
    @Override // java.util.ListIterator, java.util.Iterator
    public final void remove() {
        switch (this.l) {
            case 0:
                this.m.remove(this.n);
                this.n--;
                break;
            default:
                int i = this.n - 1;
                this.n = i;
                this.m.remove(i);
                break;
        }
    }

    /* JADX WARN: Type inference failed for: r0v1, types: [java.lang.Object, java.util.List] */
    /* JADX WARN: Type inference failed for: r0v2, types: [java.lang.Object, java.util.List] */
    @Override // java.util.ListIterator
    public final void set(Object obj) {
        switch (this.l) {
            case 0:
                this.m.set(this.n, obj);
                break;
            default:
                this.m.set(this.n, obj);
                break;
        }
    }
}
