254 lines
7.9 KiB
Java
254 lines
7.9 KiB
Java
package d0.t;
|
|
|
|
import d0.z.d.m;
|
|
import java.util.Collection;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.ListIterator;
|
|
import java.util.NoSuchElementException;
|
|
import java.util.RandomAccess;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
/* compiled from: AbstractList.kt */
|
|
public abstract class c<E> extends a<E> implements List<E>, d0.z.d.g0.a {
|
|
public static final a i = new a(null);
|
|
|
|
/* compiled from: AbstractList.kt */
|
|
public static final class a {
|
|
public a(DefaultConstructorMarker defaultConstructorMarker) {
|
|
}
|
|
|
|
public final void checkElementIndex$kotlin_stdlib(int i, int i2) {
|
|
if (i < 0 || i >= i2) {
|
|
throw new IndexOutOfBoundsException(c.d.b.a.a.n("index: ", i, ", size: ", i2));
|
|
}
|
|
}
|
|
|
|
public final void checkPositionIndex$kotlin_stdlib(int i, int i2) {
|
|
if (i < 0 || i > i2) {
|
|
throw new IndexOutOfBoundsException(c.d.b.a.a.n("index: ", i, ", size: ", i2));
|
|
}
|
|
}
|
|
|
|
public final void checkRangeIndexes$kotlin_stdlib(int i, int i2, int i3) {
|
|
if (i < 0 || i2 > i3) {
|
|
StringBuilder N = c.d.b.a.a.N("fromIndex: ", i, ", toIndex: ", i2, ", size: ");
|
|
N.append(i3);
|
|
throw new IndexOutOfBoundsException(N.toString());
|
|
} else if (i > i2) {
|
|
throw new IllegalArgumentException(c.d.b.a.a.n("fromIndex: ", i, " > toIndex: ", i2));
|
|
}
|
|
}
|
|
|
|
public final boolean orderedEquals$kotlin_stdlib(Collection<?> collection, Collection<?> collection2) {
|
|
m.checkNotNullParameter(collection, "c");
|
|
m.checkNotNullParameter(collection2, "other");
|
|
if (collection.size() != collection2.size()) {
|
|
return false;
|
|
}
|
|
Iterator<?> it = collection2.iterator();
|
|
Iterator<?> it2 = collection.iterator();
|
|
while (it2.hasNext()) {
|
|
if (!m.areEqual(it2.next(), it.next())) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public final int orderedHashCode$kotlin_stdlib(Collection<?> collection) {
|
|
m.checkNotNullParameter(collection, "c");
|
|
Iterator<?> it = collection.iterator();
|
|
int i = 1;
|
|
while (it.hasNext()) {
|
|
Object next = it.next();
|
|
i = (i * 31) + (next != null ? next.hashCode() : 0);
|
|
}
|
|
return i;
|
|
}
|
|
}
|
|
|
|
/* compiled from: AbstractList.kt */
|
|
public class b implements Iterator<E>, d0.z.d.g0.a {
|
|
public int i;
|
|
|
|
public b() {
|
|
}
|
|
|
|
@Override // java.util.Iterator
|
|
public boolean hasNext() {
|
|
return this.i < c.this.size();
|
|
}
|
|
|
|
@Override // java.util.Iterator
|
|
public E next() {
|
|
if (hasNext()) {
|
|
c cVar = c.this;
|
|
int i = this.i;
|
|
this.i = i + 1;
|
|
return (E) cVar.get(i);
|
|
}
|
|
throw new NoSuchElementException();
|
|
}
|
|
|
|
@Override // java.util.Iterator
|
|
public void remove() {
|
|
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
|
|
}
|
|
}
|
|
|
|
/* compiled from: AbstractList.kt */
|
|
/* renamed from: d0.t.c$c reason: collision with other inner class name */
|
|
public class C0294c extends c<E>.b implements ListIterator<E>, d0.z.d.g0.a {
|
|
public C0294c(int i) {
|
|
super();
|
|
c.i.checkPositionIndex$kotlin_stdlib(i, c.this.size());
|
|
this.i = i;
|
|
}
|
|
|
|
@Override // java.util.ListIterator
|
|
public void add(E e) {
|
|
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
|
|
}
|
|
|
|
@Override // java.util.ListIterator
|
|
public boolean hasPrevious() {
|
|
return this.i > 0;
|
|
}
|
|
|
|
@Override // java.util.ListIterator
|
|
public int nextIndex() {
|
|
return this.i;
|
|
}
|
|
|
|
@Override // java.util.ListIterator
|
|
public E previous() {
|
|
if (hasPrevious()) {
|
|
c cVar = c.this;
|
|
int i = this.i - 1;
|
|
this.i = i;
|
|
return (E) cVar.get(i);
|
|
}
|
|
throw new NoSuchElementException();
|
|
}
|
|
|
|
@Override // java.util.ListIterator
|
|
public int previousIndex() {
|
|
return this.i - 1;
|
|
}
|
|
|
|
@Override // java.util.ListIterator
|
|
public void set(E e) {
|
|
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
|
|
}
|
|
}
|
|
|
|
/* compiled from: AbstractList.kt */
|
|
public static final class d<E> extends c<E> implements RandomAccess {
|
|
public int j;
|
|
public final c<E> k;
|
|
public final int l;
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r2v0, resolved type: d0.t.c<? extends E> */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public d(c<? extends E> cVar, int i, int i2) {
|
|
m.checkNotNullParameter(cVar, "list");
|
|
this.k = cVar;
|
|
this.l = i;
|
|
c.i.checkRangeIndexes$kotlin_stdlib(i, i2, cVar.size());
|
|
this.j = i2 - i;
|
|
}
|
|
|
|
@Override // d0.t.c, java.util.List
|
|
public E get(int i) {
|
|
c.i.checkElementIndex$kotlin_stdlib(i, this.j);
|
|
return this.k.get(this.l + i);
|
|
}
|
|
|
|
@Override // d0.t.a
|
|
public int getSize() {
|
|
return this.j;
|
|
}
|
|
}
|
|
|
|
@Override // java.util.List
|
|
public void add(int i2, E e) {
|
|
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.lang.Object, java.util.List
|
|
public boolean equals(Object obj) {
|
|
if (obj == this) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof List)) {
|
|
return false;
|
|
}
|
|
return i.orderedEquals$kotlin_stdlib(this, (Collection) obj);
|
|
}
|
|
|
|
@Override // java.util.List
|
|
public abstract E get(int i2);
|
|
|
|
@Override // java.util.Collection, java.lang.Object, java.util.List
|
|
public int hashCode() {
|
|
return i.orderedHashCode$kotlin_stdlib(this);
|
|
}
|
|
|
|
@Override // java.util.List
|
|
public int indexOf(Object obj) {
|
|
int i2 = 0;
|
|
for (E e : this) {
|
|
if (m.areEqual(e, obj)) {
|
|
return i2;
|
|
}
|
|
i2++;
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
@Override // java.util.Collection, java.lang.Iterable, java.util.List
|
|
public Iterator<E> iterator() {
|
|
return new b();
|
|
}
|
|
|
|
@Override // java.util.List
|
|
public int lastIndexOf(Object obj) {
|
|
ListIterator<E> listIterator = listIterator(size());
|
|
while (listIterator.hasPrevious()) {
|
|
if (m.areEqual(listIterator.previous(), obj)) {
|
|
return listIterator.nextIndex();
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
@Override // java.util.List
|
|
public ListIterator<E> listIterator() {
|
|
return new C0294c(0);
|
|
}
|
|
|
|
@Override // java.util.List
|
|
public ListIterator<E> listIterator(int i2) {
|
|
return new C0294c(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 e) {
|
|
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 d(this, i2, i3);
|
|
}
|
|
}
|