- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
99 lines
4.0 KiB
Java
99 lines
4.0 KiB
Java
package androidx.collection;
|
|
|
|
import java.util.Iterator;
|
|
import kotlin.collections.IntIterator;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.functions.Function2;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
|
|
/* 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 defaultValue) {
|
|
Intrinsics.checkNotNullParameter(sparseArrayCompat, "<this>");
|
|
Intrinsics.checkNotNullParameter(defaultValue, "defaultValue");
|
|
T t = sparseArrayCompat.get(i);
|
|
return t == null ? (T) defaultValue.invoke() : t;
|
|
}
|
|
|
|
public static final <T> boolean isNotEmpty(SparseArrayCompat<T> sparseArrayCompat) {
|
|
Intrinsics.checkNotNullParameter(sparseArrayCompat, "<this>");
|
|
return !sparseArrayCompat.isEmpty();
|
|
}
|
|
|
|
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 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);
|
|
}
|
|
}
|