package e.o;

import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.NoSuchElementException;
import java.util.RandomAccess;

/* JADX INFO: loaded from: classes.dex */
public abstract class c<E> extends e.o.a<E> implements List<E>, e.s.c.t.a {

    public class a implements Iterator<E>, e.s.c.t.a {

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        public int f5947b;

        public a() {
        }

        @Override // java.util.Iterator
        public boolean hasNext() {
            return this.f5947b < c.this.a();
        }

        @Override // java.util.Iterator
        public E next() {
            if (!hasNext()) {
                throw new NoSuchElementException();
            }
            c cVar = c.this;
            int i2 = this.f5947b;
            this.f5947b = i2 + 1;
            return (E) cVar.get(i2);
        }

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

    public class b extends c<E>.a implements ListIterator<E>, e.s.c.t.a {
        public b(int i2) {
            super();
            int iA = c.this.a();
            if (i2 >= 0 && i2 <= iA) {
                this.f5947b = i2;
                return;
            }
            throw new IndexOutOfBoundsException("index: " + i2 + ", size: " + iA);
        }

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

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

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

        @Override // java.util.ListIterator
        public E previous() {
            if (!hasPrevious()) {
                throw new NoSuchElementException();
            }
            c cVar = c.this;
            int i2 = this.f5947b - 1;
            this.f5947b = i2;
            return (E) cVar.get(i2);
        }

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

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

    /* JADX INFO: renamed from: e.o.c$c, reason: collision with other inner class name */
    public static final class C0087c<E> extends c<E> implements RandomAccess {

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        public int f5950b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        public final c<E> f5951c;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        public final int f5952d;

        /* JADX WARN: Multi-variable type inference failed */
        public C0087c(c<? extends E> cVar, int i2, int i3) {
            e.s.c.i.e(cVar, "list");
            this.f5951c = cVar;
            this.f5952d = i2;
            int iA = cVar.a();
            if (i2 < 0 || i3 > iA) {
                throw new IndexOutOfBoundsException("fromIndex: " + i2 + ", toIndex: " + i3 + ", size: " + iA);
            }
            if (i2 <= i3) {
                this.f5950b = i3 - i2;
                return;
            }
            throw new IllegalArgumentException("fromIndex: " + i2 + " > toIndex: " + i3);
        }

        @Override // e.o.a
        public int a() {
            return this.f5950b;
        }

        @Override // e.o.c, java.util.List
        public E get(int i2) {
            int i3 = this.f5950b;
            if (i2 >= 0 && i2 < i3) {
                return this.f5951c.get(this.f5952d + i2);
            }
            throw new IndexOutOfBoundsException("index: " + i2 + ", size: " + i3);
        }
    }

    @Override // java.util.List
    public void add(int i2, E e2) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.List
    public boolean addAll(int i2, Collection<? extends E> collection) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.Collection, java.util.List
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof List)) {
            return false;
        }
        Collection collection = (Collection) obj;
        e.s.c.i.e(this, "c");
        e.s.c.i.e(collection, "other");
        if (size() == collection.size()) {
            Iterator<E> it = collection.iterator();
            Iterator<E> it2 = iterator();
            while (it2.hasNext()) {
                if (!e.s.c.i.a(it2.next(), it.next())) {
                }
            }
            return true;
        }
        return false;
    }

    @Override // java.util.List
    public abstract E get(int i2);

    @Override // java.util.Collection, java.util.List
    public int hashCode() {
        e.s.c.i.e(this, "c");
        Iterator<E> it = iterator();
        int iHashCode = 1;
        while (it.hasNext()) {
            E next = it.next();
            iHashCode = (iHashCode * 31) + (next != null ? next.hashCode() : 0);
        }
        return iHashCode;
    }

    @Override // java.util.List
    public int indexOf(Object obj) {
        Iterator<E> it = iterator();
        int i2 = 0;
        while (it.hasNext()) {
            if (e.s.c.i.a(it.next(), obj)) {
                return i2;
            }
            i2++;
        }
        return -1;
    }

    @Override // java.util.Collection, java.lang.Iterable, java.util.List
    public Iterator<E> iterator() {
        return new a();
    }

    @Override // java.util.List
    public int lastIndexOf(Object obj) {
        ListIterator<E> listIterator = listIterator(size());
        while (listIterator.hasPrevious()) {
            if (e.s.c.i.a(listIterator.previous(), obj)) {
                return listIterator.nextIndex();
            }
        }
        return -1;
    }

    @Override // java.util.List
    public ListIterator<E> listIterator() {
        return new b(0);
    }

    @Override // java.util.List
    public ListIterator<E> listIterator(int i2) {
        return new b(i2);
    }

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

    @Override // java.util.List
    public E set(int i2, E e2) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.List
    public List<E> subList(int i2, int i3) {
        return new C0087c(this, i2, i3);
    }
}
