- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
60 lines
1.8 KiB
Java
60 lines
1.8 KiB
Java
package androidx.collection.internal;
|
|
|
|
import java.util.LinkedHashMap;
|
|
import java.util.Map;
|
|
import java.util.Set;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
|
|
/* loaded from: classes.dex */
|
|
public final class LruHashMap<K, V> {
|
|
private final LinkedHashMap<K, V> map;
|
|
|
|
public LruHashMap() {
|
|
this(0, 0.0f, 3, null);
|
|
}
|
|
|
|
public LruHashMap(int i, float f) {
|
|
this.map = new LinkedHashMap<>(i, f, true);
|
|
}
|
|
|
|
public /* synthetic */ LruHashMap(int i, float f, int i2, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this((i2 & 1) != 0 ? 16 : i, (i2 & 2) != 0 ? 0.75f : f);
|
|
}
|
|
|
|
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
|
|
public LruHashMap(LruHashMap<? extends K, V> original) {
|
|
this(0, 0.0f, 3, null);
|
|
Intrinsics.checkNotNullParameter(original, "original");
|
|
for (Map.Entry<? extends K, V> entry : original.getEntries()) {
|
|
put(entry.getKey(), entry.getValue());
|
|
}
|
|
}
|
|
|
|
public final boolean isEmpty() {
|
|
return this.map.isEmpty();
|
|
}
|
|
|
|
public final Set<Map.Entry<K, V>> getEntries() {
|
|
Set<Map.Entry<K, V>> entrySet = this.map.entrySet();
|
|
Intrinsics.checkNotNullExpressionValue(entrySet, "map.entries");
|
|
return entrySet;
|
|
}
|
|
|
|
public final V get(K key) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
return this.map.get(key);
|
|
}
|
|
|
|
public final V put(K key, V value) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
Intrinsics.checkNotNullParameter(value, "value");
|
|
return this.map.put(key, value);
|
|
}
|
|
|
|
public final V remove(K key) {
|
|
Intrinsics.checkNotNullParameter(key, "key");
|
|
return this.map.remove(key);
|
|
}
|
|
}
|