discord-jadx/app/src/main/java/androidx/recyclerview/widget/StableIdStorage.java

97 lines
3.2 KiB
Java

package androidx.recyclerview.widget;
import androidx.annotation.NonNull;
import androidx.collection.LongSparseArray;
/* loaded from: classes.dex */
public interface StableIdStorage {
/* loaded from: classes.dex */
public static class IsolatedStableIdStorage implements StableIdStorage {
public long mNextStableId = 0;
/* loaded from: classes.dex */
public class WrapperStableIdLookup implements StableIdLookup {
private final LongSparseArray<Long> mLocalToGlobalLookup = new LongSparseArray<>();
public WrapperStableIdLookup() {
}
@Override // androidx.recyclerview.widget.StableIdStorage.StableIdLookup
public long localToGlobal(long j) {
Long l = this.mLocalToGlobalLookup.get(j);
if (l == null) {
l = Long.valueOf(IsolatedStableIdStorage.this.obtainId());
this.mLocalToGlobalLookup.put(j, l);
}
return l.longValue();
}
}
@Override // androidx.recyclerview.widget.StableIdStorage
@NonNull
public StableIdLookup createStableIdLookup() {
return new WrapperStableIdLookup();
}
public long obtainId() {
long j = this.mNextStableId;
this.mNextStableId = 1 + j;
return j;
}
}
/* loaded from: classes.dex */
public static class NoStableIdStorage implements StableIdStorage {
private final StableIdLookup mNoIdLookup = new AnonymousClass1();
/* renamed from: androidx.recyclerview.widget.StableIdStorage$NoStableIdStorage$1 reason: invalid class name */
/* loaded from: classes.dex */
public class AnonymousClass1 implements StableIdLookup {
public AnonymousClass1() {
}
@Override // androidx.recyclerview.widget.StableIdStorage.StableIdLookup
public long localToGlobal(long j) {
return -1L;
}
}
@Override // androidx.recyclerview.widget.StableIdStorage
@NonNull
public StableIdLookup createStableIdLookup() {
return this.mNoIdLookup;
}
}
/* loaded from: classes.dex */
public static class SharedPoolStableIdStorage implements StableIdStorage {
private final StableIdLookup mSameIdLookup = new AnonymousClass1();
/* renamed from: androidx.recyclerview.widget.StableIdStorage$SharedPoolStableIdStorage$1 reason: invalid class name */
/* loaded from: classes.dex */
public class AnonymousClass1 implements StableIdLookup {
public AnonymousClass1() {
}
@Override // androidx.recyclerview.widget.StableIdStorage.StableIdLookup
public long localToGlobal(long j) {
return j;
}
}
@Override // androidx.recyclerview.widget.StableIdStorage
@NonNull
public StableIdLookup createStableIdLookup() {
return this.mSameIdLookup;
}
}
/* loaded from: classes.dex */
public interface StableIdLookup {
long localToGlobal(long j);
}
@NonNull
StableIdLookup createStableIdLookup();
}