package t8; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.ListIterator; import java.util.NoSuchElementException; import java.util.RandomAccess; /* loaded from: classes2.dex */ public abstract class c extends t8.a implements List { /* renamed from: a, reason: collision with root package name */ public static final a f14423a = new a(null); public static final class a { private a() { } public /* synthetic */ a(d9.g gVar) { this(); } public final void a(int i10, int i11) { if (i10 < 0 || i10 >= i11) { throw new IndexOutOfBoundsException("index: " + i10 + ", size: " + i11); } } public final void b(int i10, int i11) { if (i10 < 0 || i10 > i11) { throw new IndexOutOfBoundsException("index: " + i10 + ", size: " + i11); } } public final void c(int i10, int i11, int i12) { if (i10 < 0 || i11 > i12) { throw new IndexOutOfBoundsException("fromIndex: " + i10 + ", toIndex: " + i11 + ", size: " + i12); } if (i10 <= i11) { return; } throw new IllegalArgumentException("fromIndex: " + i10 + " > toIndex: " + i11); } public final boolean d(Collection collection, Collection collection2) { d9.j.e(collection, "c"); d9.j.e(collection2, "other"); if (collection.size() != collection2.size()) { return false; } Iterator it = collection2.iterator(); Iterator it2 = collection.iterator(); while (it2.hasNext()) { if (!d9.j.a(it2.next(), it.next())) { return false; } } return true; } public final int e(Collection collection) { d9.j.e(collection, "c"); Iterator it = collection.iterator(); int i10 = 1; while (it.hasNext()) { Object next = it.next(); i10 = (i10 * 31) + (next != null ? next.hashCode() : 0); } return i10; } } private class b implements Iterator { /* renamed from: a, reason: collision with root package name */ private int f14424a; public b() { } protected final int a() { return this.f14424a; } protected final void b(int i10) { this.f14424a = i10; } @Override // java.util.Iterator public boolean hasNext() { return this.f14424a < c.this.size(); } @Override // java.util.Iterator public Object next() { if (!hasNext()) { throw new NoSuchElementException(); } c cVar = c.this; int i10 = this.f14424a; this.f14424a = i10 + 1; return cVar.get(i10); } @Override // java.util.Iterator public void remove() { throw new UnsupportedOperationException("Operation is not supported for read-only collection"); } } /* renamed from: t8.c$c, reason: collision with other inner class name */ private class C0235c extends b implements ListIterator { public C0235c(int i10) { super(); c.f14423a.b(i10, c.this.size()); b(i10); } @Override // java.util.ListIterator public void add(Object obj) { throw new UnsupportedOperationException("Operation is not supported for read-only collection"); } @Override // java.util.ListIterator public boolean hasPrevious() { return a() > 0; } @Override // java.util.ListIterator public int nextIndex() { return a(); } @Override // java.util.ListIterator public Object previous() { if (!hasPrevious()) { throw new NoSuchElementException(); } c cVar = c.this; b(a() - 1); return cVar.get(a()); } @Override // java.util.ListIterator public int previousIndex() { return a() - 1; } @Override // java.util.ListIterator public void set(Object obj) { throw new UnsupportedOperationException("Operation is not supported for read-only collection"); } } private static final class d extends c implements RandomAccess { /* renamed from: b, reason: collision with root package name */ private final c f14427b; /* renamed from: c, reason: collision with root package name */ private final int f14428c; /* renamed from: d, reason: collision with root package name */ private int f14429d; public d(c cVar, int i10, int i11) { d9.j.e(cVar, "list"); this.f14427b = cVar; this.f14428c = i10; c.f14423a.c(i10, i11, cVar.size()); this.f14429d = i11 - i10; } @Override // t8.a public int a() { return this.f14429d; } @Override // t8.c, java.util.List public Object get(int i10) { c.f14423a.a(i10, this.f14429d); return this.f14427b.get(this.f14428c + i10); } } protected c() { } @Override // java.util.List public void add(int i10, Object obj) { throw new UnsupportedOperationException("Operation is not supported for read-only collection"); } @Override // java.util.List public boolean addAll(int i10, Collection 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 f14423a.d(this, (Collection) obj); } return false; } @Override // java.util.List public abstract Object get(int i10); @Override // java.util.Collection, java.util.List public int hashCode() { return f14423a.e(this); } @Override // java.util.List public int indexOf(Object obj) { Iterator it = iterator(); int i10 = 0; while (it.hasNext()) { if (d9.j.a(it.next(), obj)) { return i10; } i10++; } return -1; } @Override // java.util.Collection, java.lang.Iterable, java.util.List public Iterator iterator() { return new b(); } @Override // java.util.List public int lastIndexOf(Object obj) { ListIterator listIterator = listIterator(size()); while (listIterator.hasPrevious()) { if (d9.j.a(listIterator.previous(), obj)) { return listIterator.nextIndex(); } } return -1; } @Override // java.util.List public ListIterator listIterator() { return new C0235c(0); } @Override // java.util.List public Object remove(int i10) { throw new UnsupportedOperationException("Operation is not supported for read-only collection"); } @Override // java.util.List public Object set(int i10, Object obj) { throw new UnsupportedOperationException("Operation is not supported for read-only collection"); } @Override // java.util.List public List subList(int i10, int i11) { return new d(this, i10, i11); } @Override // java.util.List public ListIterator listIterator(int i10) { return new C0235c(i10); } }