Rabbit-R1/original r1/java/sources/io/flutter/embedding/engine/FlutterEngineGroupCache.java
2024-05-21 17:08:36 -04:00

48 lines
1.3 KiB
Java

package io.flutter.embedding.engine;
import java.util.HashMap;
import java.util.Map;
/* loaded from: classes3.dex */
public class FlutterEngineGroupCache {
private static volatile FlutterEngineGroupCache instance;
private final Map<String, FlutterEngineGroup> cachedEngineGroups = new HashMap();
public static FlutterEngineGroupCache getInstance() {
if (instance == null) {
synchronized (FlutterEngineGroupCache.class) {
if (instance == null) {
instance = new FlutterEngineGroupCache();
}
}
}
return instance;
}
FlutterEngineGroupCache() {
}
public boolean contains(String str) {
return this.cachedEngineGroups.containsKey(str);
}
public FlutterEngineGroup get(String str) {
return this.cachedEngineGroups.get(str);
}
public void put(String str, FlutterEngineGroup flutterEngineGroup) {
if (flutterEngineGroup != null) {
this.cachedEngineGroups.put(str, flutterEngineGroup);
} else {
this.cachedEngineGroups.remove(str);
}
}
public void remove(String str) {
put(str, null);
}
public void clear() {
this.cachedEngineGroups.clear();
}
}