mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2025-01-09 13:43:22 +00:00
106 lines
7.5 KiB
Java
106 lines
7.5 KiB
Java
package androidx.collection;
|
|
|
|
import androidx.exifinterface.media.ExifInterface;
|
|
import java.util.Iterator;
|
|
import kotlin.Deprecated;
|
|
import kotlin.DeprecationLevel;
|
|
import kotlin.Metadata;
|
|
import kotlin.Unit;
|
|
import kotlin.collections.IntIterator;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.functions.Function2;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
|
|
/* compiled from: SparseArray.kt */
|
|
@Metadata(d1 = {"\u0000@\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0010(\n\u0000\u001a!\u0010\u0006\u001a\u00020\u0007\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u00032\u0006\u0010\b\u001a\u00020\u0001H\u0086\n\u001aT\u0010\t\u001a\u00020\n\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u000326\u0010\u000b\u001a2\u0012\u0013\u0012\u00110\u0001¢\u0006\f\b\r\u0012\b\b\u000e\u0012\u0004\b\b(\b\u0012\u0013\u0012\u0011H\u0002¢\u0006\f\b\r\u0012\b\b\u000e\u0012\u0004\b\b(\u000f\u0012\u0004\u0012\u00020\n0\fH\u0086\bø\u0001\u0000\u001a.\u0010\u0010\u001a\u0002H\u0002\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u00032\u0006\u0010\b\u001a\u00020\u00012\u0006\u0010\u0011\u001a\u0002H\u0002H\u0086\b¢\u0006\u0002\u0010\u0012\u001a7\u0010\u0013\u001a\u0002H\u0002\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u00032\u0006\u0010\b\u001a\u00020\u00012\f\u0010\u0011\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0014H\u0086\bø\u0001\u0000¢\u0006\u0002\u0010\u0015\u001a\u0019\u0010\u0016\u001a\u00020\u0007\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u0003H\u0086\b\u001a\u0016\u0010\u0017\u001a\u00020\u0018\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u0003\u001a-\u0010\u0019\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0003\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u00032\f\u0010\u001a\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0003H\u0086\u0002\u001a-\u0010\u001b\u001a\u00020\u0007\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u00032\u0006\u0010\b\u001a\u00020\u00012\u0006\u0010\u000f\u001a\u0002H\u0002H\u0007¢\u0006\u0002\u0010\u001c\u001a.\u0010\u001d\u001a\u00020\n\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u00032\u0006\u0010\b\u001a\u00020\u00012\u0006\u0010\u000f\u001a\u0002H\u0002H\u0086\n¢\u0006\u0002\u0010\u001e\u001a\u001c\u0010\u001f\u001a\b\u0012\u0004\u0012\u0002H\u00020 \"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u0003\"\"\u0010\u0000\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u00038Æ\u0002¢\u0006\u0006\u001a\u0004\b\u0004\u0010\u0005\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006!"}, d2 = {"size", "", ExifInterface.GPS_DIRECTION_TRUE, "Landroidx/collection/SparseArrayCompat;", "getSize", "(Landroidx/collection/SparseArrayCompat;)I", "contains", "", "key", "forEach", "", "action", "Lkotlin/Function2;", "Lkotlin/ParameterName;", "name", "value", "getOrDefault", "defaultValue", "(Landroidx/collection/SparseArrayCompat;ILjava/lang/Object;)Ljava/lang/Object;", "getOrElse", "Lkotlin/Function0;", "(Landroidx/collection/SparseArrayCompat;ILkotlin/jvm/functions/Function0;)Ljava/lang/Object;", "isNotEmpty", "keyIterator", "Lkotlin/collections/IntIterator;", "plus", "other", "remove", "(Landroidx/collection/SparseArrayCompat;ILjava/lang/Object;)Z", "set", "(Landroidx/collection/SparseArrayCompat;ILjava/lang/Object;)V", "valueIterator", "", "collection"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
|
/* loaded from: classes.dex */
|
|
public final class SparseArrayKt {
|
|
public static final <T> int getSize(SparseArrayCompat<T> sparseArrayCompat) {
|
|
Intrinsics.checkNotNullParameter(sparseArrayCompat, "<this>");
|
|
return sparseArrayCompat.size();
|
|
}
|
|
|
|
public static final <T> boolean contains(SparseArrayCompat<T> sparseArrayCompat, int i) {
|
|
Intrinsics.checkNotNullParameter(sparseArrayCompat, "<this>");
|
|
return sparseArrayCompat.containsKey(i);
|
|
}
|
|
|
|
public static final <T> void set(SparseArrayCompat<T> sparseArrayCompat, int i, T t) {
|
|
Intrinsics.checkNotNullParameter(sparseArrayCompat, "<this>");
|
|
sparseArrayCompat.put(i, t);
|
|
}
|
|
|
|
public static final <T> SparseArrayCompat<T> plus(SparseArrayCompat<T> sparseArrayCompat, SparseArrayCompat<T> other) {
|
|
Intrinsics.checkNotNullParameter(sparseArrayCompat, "<this>");
|
|
Intrinsics.checkNotNullParameter(other, "other");
|
|
SparseArrayCompat<T> sparseArrayCompat2 = new SparseArrayCompat<>(sparseArrayCompat.size() + other.size());
|
|
sparseArrayCompat2.putAll(sparseArrayCompat);
|
|
sparseArrayCompat2.putAll(other);
|
|
return sparseArrayCompat2;
|
|
}
|
|
|
|
public static final <T> T getOrDefault(SparseArrayCompat<T> sparseArrayCompat, int i, T t) {
|
|
Intrinsics.checkNotNullParameter(sparseArrayCompat, "<this>");
|
|
return sparseArrayCompat.get(i, t);
|
|
}
|
|
|
|
public static final <T> T getOrElse(SparseArrayCompat<T> sparseArrayCompat, int i, Function0<? extends T> defaultValue) {
|
|
Intrinsics.checkNotNullParameter(sparseArrayCompat, "<this>");
|
|
Intrinsics.checkNotNullParameter(defaultValue, "defaultValue");
|
|
T t = sparseArrayCompat.get(i);
|
|
return t == null ? defaultValue.invoke() : t;
|
|
}
|
|
|
|
public static final <T> boolean isNotEmpty(SparseArrayCompat<T> sparseArrayCompat) {
|
|
Intrinsics.checkNotNullParameter(sparseArrayCompat, "<this>");
|
|
return !sparseArrayCompat.isEmpty();
|
|
}
|
|
|
|
@Deprecated(level = DeprecationLevel.HIDDEN, message = "Replaced with member function. Remove extension import!")
|
|
public static final /* synthetic */ boolean remove(SparseArrayCompat sparseArrayCompat, int i, Object obj) {
|
|
Intrinsics.checkNotNullParameter(sparseArrayCompat, "<this>");
|
|
return sparseArrayCompat.remove(i, obj);
|
|
}
|
|
|
|
public static final <T> void forEach(SparseArrayCompat<T> sparseArrayCompat, Function2<? super Integer, ? super T, Unit> action) {
|
|
Intrinsics.checkNotNullParameter(sparseArrayCompat, "<this>");
|
|
Intrinsics.checkNotNullParameter(action, "action");
|
|
int size = sparseArrayCompat.size();
|
|
for (int i = 0; i < size; i++) {
|
|
action.invoke(Integer.valueOf(sparseArrayCompat.keyAt(i)), sparseArrayCompat.valueAt(i));
|
|
}
|
|
}
|
|
|
|
public static final <T> IntIterator keyIterator(final SparseArrayCompat<T> sparseArrayCompat) {
|
|
Intrinsics.checkNotNullParameter(sparseArrayCompat, "<this>");
|
|
return new IntIterator() { // from class: androidx.collection.SparseArrayKt$keyIterator$1
|
|
private int index;
|
|
|
|
public final int getIndex() {
|
|
return this.index;
|
|
}
|
|
|
|
public final void setIndex(int i) {
|
|
this.index = i;
|
|
}
|
|
|
|
@Override // java.util.Iterator
|
|
public boolean hasNext() {
|
|
return this.index < sparseArrayCompat.size();
|
|
}
|
|
|
|
@Override // kotlin.collections.IntIterator
|
|
public int nextInt() {
|
|
SparseArrayCompat<T> sparseArrayCompat2 = sparseArrayCompat;
|
|
int i = this.index;
|
|
this.index = i + 1;
|
|
return sparseArrayCompat2.keyAt(i);
|
|
}
|
|
};
|
|
}
|
|
|
|
public static final <T> Iterator<T> valueIterator(SparseArrayCompat<T> sparseArrayCompat) {
|
|
Intrinsics.checkNotNullParameter(sparseArrayCompat, "<this>");
|
|
return new SparseArrayKt$valueIterator$1(sparseArrayCompat);
|
|
}
|
|
}
|