package androidx.collection; import androidx.annotation.IntRange; import com.ironsource.v8; import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; import kotlin.jvm.functions.Function1; import kotlin.jvm.functions.Function2; import kotlin.jvm.functions.Function3; import kotlin.jvm.internal.DefaultConstructorMarker; import kotlin.jvm.internal.Intrinsics; import kotlin.jvm.internal.SourceDebugExtension; import kotlin.ranges.RangesKt___RangesKt; @SourceDebugExtension({"SMAP\nObjectList.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ObjectList.kt\nandroidx/collection/ObjectList\n+ 2 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,1618:1\n305#1,6:1619\n331#1,6:1625\n305#1,6:1633\n305#1,6:1639\n305#1,6:1645\n305#1,6:1651\n305#1,6:1657\n318#1,6:1663\n331#1,6:1669\n345#1,6:1675\n75#1:1681\n75#1:1682\n318#1,6:1683\n318#1,6:1689\n318#1,6:1695\n345#1,6:1701\n75#1:1707\n331#1,6:1708\n75#1:1714\n331#1,6:1715\n345#1,6:1721\n345#1,6:1727\n318#1,6:1733\n305#1,6:1739\n80#1:1745\n1855#2,2:1631\n*S KotlinDebug\n*F\n+ 1 ObjectList.kt\nandroidx/collection/ObjectList\n*L\n101#1:1619,6\n115#1:1625,6\n168#1:1633,6\n186#1:1639,6\n209#1:1645,6\n227#1:1651,6\n244#1:1657,6\n260#1:1663,6\n277#1:1669,6\n293#1:1675,6\n358#1:1681\n369#1:1682\n399#1:1683,6\n405#1:1689,6\n421#1:1695,6\n435#1:1701,6\n461#1:1707\n472#1:1708,6\n483#1:1714\n492#1:1715,6\n509#1:1721,6\n515#1:1727,6\n545#1:1733,6\n576#1:1739,6\n592#1:1745\n157#1:1631,2\n*E\n"}) /* loaded from: classes.dex */ public abstract class ObjectList { public int _size; public Object[] content; public /* synthetic */ ObjectList(int i, DefaultConstructorMarker defaultConstructorMarker) { this(i); } public static /* synthetic */ void getContent$annotations() { } public static /* synthetic */ void get_size$annotations() { } public abstract List asList(); public final int count() { return this._size; } @IntRange(from = -1) public final int getLastIndex() { return this._size - 1; } @IntRange(from = 0) public final int getSize() { return this._size; } public final boolean isEmpty() { return this._size == 0; } public final boolean isNotEmpty() { return this._size != 0; } public final String joinToString() { return joinToString$default(this, null, null, null, 0, null, null, 63, null); } public final String joinToString(CharSequence separator) { Intrinsics.checkNotNullParameter(separator, "separator"); return joinToString$default(this, separator, null, null, 0, null, null, 62, null); } public final String joinToString(CharSequence separator, CharSequence prefix) { Intrinsics.checkNotNullParameter(separator, "separator"); Intrinsics.checkNotNullParameter(prefix, "prefix"); return joinToString$default(this, separator, prefix, null, 0, null, null, 60, null); } public final String joinToString(CharSequence separator, CharSequence prefix, CharSequence postfix) { Intrinsics.checkNotNullParameter(separator, "separator"); Intrinsics.checkNotNullParameter(prefix, "prefix"); Intrinsics.checkNotNullParameter(postfix, "postfix"); return joinToString$default(this, separator, prefix, postfix, 0, null, null, 56, null); } public final String joinToString(CharSequence separator, CharSequence prefix, CharSequence postfix, int i) { Intrinsics.checkNotNullParameter(separator, "separator"); Intrinsics.checkNotNullParameter(prefix, "prefix"); Intrinsics.checkNotNullParameter(postfix, "postfix"); return joinToString$default(this, separator, prefix, postfix, i, null, null, 48, null); } public final String joinToString(CharSequence separator, CharSequence prefix, CharSequence postfix, int i, CharSequence truncated) { Intrinsics.checkNotNullParameter(separator, "separator"); Intrinsics.checkNotNullParameter(prefix, "prefix"); Intrinsics.checkNotNullParameter(postfix, "postfix"); Intrinsics.checkNotNullParameter(truncated, "truncated"); return joinToString$default(this, separator, prefix, postfix, i, truncated, null, 32, null); } private ObjectList(int i) { Object[] objArr; if (i == 0) { objArr = ObjectListKt.EmptyArray; } else { objArr = new Object[i]; } this.content = objArr; } public final kotlin.ranges.IntRange getIndices() { kotlin.ranges.IntRange until; until = RangesKt___RangesKt.until(0, this._size); return until; } public final boolean none() { return isEmpty(); } public final boolean any() { return isNotEmpty(); } public final boolean contains(E e) { return indexOf(e) >= 0; } public final boolean containsAll(E[] elements) { Intrinsics.checkNotNullParameter(elements, "elements"); for (E e : elements) { if (!contains(e)) { return false; } } return true; } public final boolean containsAll(List elements) { Intrinsics.checkNotNullParameter(elements, "elements"); int size = elements.size(); for (int i = 0; i < size; i++) { if (!contains(elements.get(i))) { return false; } } return true; } public final E first() { if (isEmpty()) { throw new NoSuchElementException("ObjectList is empty."); } return (E) this.content[0]; } public final E firstOrNull() { if (isEmpty()) { return null; } return get(0); } /* JADX WARN: Multi-variable type inference failed */ public final boolean containsAll(ObjectList elements) { Intrinsics.checkNotNullParameter(elements, "elements"); Object[] objArr = elements.content; int i = elements._size; for (int i2 = 0; i2 < i; i2++) { if (!contains(objArr[i2])) { return false; } } return true; } public final boolean any(Function1 predicate) { Intrinsics.checkNotNullParameter(predicate, "predicate"); Object[] objArr = this.content; int i = this._size; for (int i2 = 0; i2 < i; i2++) { if (((Boolean) predicate.invoke(objArr[i2])).booleanValue()) { return true; } } return false; } public final int count(Function1 predicate) { Intrinsics.checkNotNullParameter(predicate, "predicate"); Object[] objArr = this.content; int i = this._size; int i2 = 0; for (int i3 = 0; i3 < i; i3++) { if (((Boolean) predicate.invoke(objArr[i3])).booleanValue()) { i2++; } } return i2; } public final E first(Function1 predicate) { Intrinsics.checkNotNullParameter(predicate, "predicate"); Object[] objArr = this.content; int i = this._size; for (int i2 = 0; i2 < i; i2++) { E e = (E) objArr[i2]; if (((Boolean) predicate.invoke(e)).booleanValue()) { return e; } } throw new NoSuchElementException("ObjectList contains no element matching the predicate."); } public final E firstOrNull(Function1 predicate) { Intrinsics.checkNotNullParameter(predicate, "predicate"); Object[] objArr = this.content; int i = this._size; for (int i2 = 0; i2 < i; i2++) { E e = (E) objArr[i2]; if (((Boolean) predicate.invoke(e)).booleanValue()) { return e; } } return null; } public final R fold(R r, Function2 operation) { Intrinsics.checkNotNullParameter(operation, "operation"); Object[] objArr = this.content; int i = this._size; for (int i2 = 0; i2 < i; i2++) { r = (R) operation.invoke(r, objArr[i2]); } return r; } public final void forEach(Function1 block) { Intrinsics.checkNotNullParameter(block, "block"); Object[] objArr = this.content; int i = this._size; for (int i2 = 0; i2 < i; i2++) { block.invoke(objArr[i2]); } } public int hashCode() { Object[] objArr = this.content; int i = this._size; int i2 = 0; for (int i3 = 0; i3 < i; i3++) { Object obj = objArr[i3]; i2 += (obj != null ? obj.hashCode() : 0) * 31; } return i2; } public final R foldIndexed(R r, Function3 operation) { Intrinsics.checkNotNullParameter(operation, "operation"); Object[] objArr = this.content; int i = this._size; for (int i2 = 0; i2 < i; i2++) { r = (R) operation.invoke(Integer.valueOf(i2), r, objArr[i2]); } return r; } public final void forEachIndexed(Function2 block) { Intrinsics.checkNotNullParameter(block, "block"); Object[] objArr = this.content; int i = this._size; for (int i2 = 0; i2 < i; i2++) { block.invoke(Integer.valueOf(i2), objArr[i2]); } } public final int indexOf(E e) { int i = 0; if (e == null) { Object[] objArr = this.content; int i2 = this._size; while (i < i2) { if (objArr[i] == null) { return i; } i++; } return -1; } Object[] objArr2 = this.content; int i3 = this._size; while (i < i3) { if (e.equals(objArr2[i])) { return i; } i++; } return -1; } public final int indexOfFirst(Function1 predicate) { Intrinsics.checkNotNullParameter(predicate, "predicate"); Object[] objArr = this.content; int i = this._size; for (int i2 = 0; i2 < i; i2++) { if (((Boolean) predicate.invoke(objArr[i2])).booleanValue()) { return i2; } } return -1; } public final R foldRight(R r, Function2 operation) { Intrinsics.checkNotNullParameter(operation, "operation"); Object[] objArr = this.content; int i = this._size; while (true) { i--; if (-1 >= i) { return r; } r = (R) operation.invoke(objArr[i], r); } } public final void forEachReversed(Function1 block) { Intrinsics.checkNotNullParameter(block, "block"); Object[] objArr = this.content; int i = this._size; while (true) { i--; if (-1 >= i) { return; } else { block.invoke(objArr[i]); } } } public final E last(Function1 predicate) { E e; Intrinsics.checkNotNullParameter(predicate, "predicate"); Object[] objArr = this.content; int i = this._size; do { i--; if (-1 < i) { e = (E) objArr[i]; } else { throw new NoSuchElementException("ObjectList contains no element matching the predicate."); } } while (!((Boolean) predicate.invoke(e)).booleanValue()); return e; } public final E lastOrNull(Function1 predicate) { E e; Intrinsics.checkNotNullParameter(predicate, "predicate"); Object[] objArr = this.content; int i = this._size; do { i--; if (-1 >= i) { return null; } e = (E) objArr[i]; } while (!((Boolean) predicate.invoke(e)).booleanValue()); return e; } public final boolean reversedAny(Function1 predicate) { Intrinsics.checkNotNullParameter(predicate, "predicate"); Object[] objArr = this.content; for (int i = this._size - 1; -1 < i; i--) { if (((Boolean) predicate.invoke(objArr[i])).booleanValue()) { return true; } } return false; } public final R foldRightIndexed(R r, Function3 operation) { Intrinsics.checkNotNullParameter(operation, "operation"); Object[] objArr = this.content; int i = this._size; while (true) { i--; if (-1 >= i) { return r; } r = (R) operation.invoke(Integer.valueOf(i), objArr[i], r); } } public final void forEachReversedIndexed(Function2 block) { Intrinsics.checkNotNullParameter(block, "block"); Object[] objArr = this.content; int i = this._size; while (true) { i--; if (-1 >= i) { return; } else { block.invoke(Integer.valueOf(i), objArr[i]); } } } public final int indexOfLast(Function1 predicate) { Intrinsics.checkNotNullParameter(predicate, "predicate"); Object[] objArr = this.content; int i = this._size; do { i--; if (-1 >= i) { return -1; } } while (!((Boolean) predicate.invoke(objArr[i])).booleanValue()); return i; } public final int lastIndexOf(E e) { if (e == null) { Object[] objArr = this.content; for (int i = this._size - 1; -1 < i; i--) { if (objArr[i] == null) { return i; } } } else { Object[] objArr2 = this.content; for (int i2 = this._size - 1; -1 < i2; i2--) { if (e.equals(objArr2[i2])) { return i2; } } } return -1; } public final E get(@IntRange(from = 0) int i) { if (i < 0 || i >= this._size) { StringBuilder sb = new StringBuilder(); sb.append("Index "); sb.append(i); sb.append(" must be in 0.."); sb.append(this._size - 1); throw new IndexOutOfBoundsException(sb.toString()); } return (E) this.content[i]; } public final E elementAt(@IntRange(from = 0) int i) { if (i < 0 || i >= this._size) { StringBuilder sb = new StringBuilder(); sb.append("Index "); sb.append(i); sb.append(" must be in 0.."); sb.append(this._size - 1); throw new IndexOutOfBoundsException(sb.toString()); } return (E) this.content[i]; } public final E elementAtOrElse(@IntRange(from = 0) int i, Function1 defaultValue) { Intrinsics.checkNotNullParameter(defaultValue, "defaultValue"); if (i < 0 || i >= this._size) { return (E) defaultValue.invoke(Integer.valueOf(i)); } return (E) this.content[i]; } public final E last() { if (!isEmpty()) { return (E) this.content[this._size - 1]; } throw new NoSuchElementException("ObjectList is empty."); } public final E lastOrNull() { if (isEmpty()) { return null; } return (E) this.content[this._size - 1]; } public static /* synthetic */ String joinToString$default(ObjectList objectList, CharSequence charSequence, CharSequence charSequence2, CharSequence charSequence3, int i, CharSequence charSequence4, Function1 function1, int i2, Object obj) { if (obj != null) { throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: joinToString"); } if ((i2 & 1) != 0) { charSequence = ", "; } CharSequence charSequence5 = (i2 & 2) != 0 ? "" : charSequence2; CharSequence charSequence6 = (i2 & 4) == 0 ? charSequence3 : ""; if ((i2 & 8) != 0) { i = -1; } int i3 = i; if ((i2 & 16) != 0) { charSequence4 = "..."; } CharSequence charSequence7 = charSequence4; if ((i2 & 32) != 0) { function1 = null; } return objectList.joinToString(charSequence, charSequence5, charSequence6, i3, charSequence7, function1); } public final String joinToString(CharSequence separator, CharSequence prefix, CharSequence postfix, int i, CharSequence truncated, Function1 function1) { Intrinsics.checkNotNullParameter(separator, "separator"); Intrinsics.checkNotNullParameter(prefix, "prefix"); Intrinsics.checkNotNullParameter(postfix, "postfix"); Intrinsics.checkNotNullParameter(truncated, "truncated"); StringBuilder sb = new StringBuilder(); sb.append(prefix); Object[] objArr = this.content; int i2 = this._size; int i3 = 0; while (true) { if (i3 < i2) { Object obj = objArr[i3]; if (i3 == i) { sb.append(truncated); break; } if (i3 != 0) { sb.append(separator); } if (function1 == null) { sb.append(obj); } else { sb.append((CharSequence) function1.invoke(obj)); } i3++; } else { sb.append(postfix); break; } } String sb2 = sb.toString(); Intrinsics.checkNotNullExpressionValue(sb2, "StringBuilder().apply(builderAction).toString()"); return sb2; } public boolean equals(Object obj) { kotlin.ranges.IntRange until; if (obj instanceof ObjectList) { ObjectList objectList = (ObjectList) obj; int i = objectList._size; int i2 = this._size; if (i == i2) { Object[] objArr = this.content; Object[] objArr2 = objectList.content; until = RangesKt___RangesKt.until(0, i2); int first = until.getFirst(); int last = until.getLast(); if (first > last) { return true; } while (Intrinsics.areEqual(objArr[first], objArr2[first])) { if (first == last) { return true; } first++; } return false; } } return false; } public String toString() { return joinToString$default(this, null, v8.i.d, v8.i.e, 0, null, new Function1(this) { // from class: androidx.collection.ObjectList$toString$1 final /* synthetic */ ObjectList this$0; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ { super(1); this.this$0 = this; } @Override // kotlin.jvm.functions.Function1 public /* bridge */ /* synthetic */ Object invoke(Object obj) { return invoke((ObjectList$toString$1) obj); } @Override // kotlin.jvm.functions.Function1 public final CharSequence invoke(E e) { return e == this.this$0 ? "(this)" : String.valueOf(e); } }, 25, null); } public final boolean containsAll(Iterable elements) { Intrinsics.checkNotNullParameter(elements, "elements"); Iterator it = elements.iterator(); while (it.hasNext()) { if (!contains(it.next())) { return false; } } return true; } }