Package io.flutter.embedding.engine
Class FlutterEngineGroupCache
- java.lang.Object
-
- io.flutter.embedding.engine.FlutterEngineGroupCache
-
public class FlutterEngineGroupCache extends Object
Static singleton cache that holdsFlutterEngineGroupinstances identified byStrings.The ID of a given
FlutterEngineGroupcan be whateverStringis desired.FlutterActivityandFlutterFragmentuse theFlutterEngineGroupCachesingleton internally when instructed to use a cachedFlutterEngineGroupbased on a given ID. SeeFlutterActivity.NewEngineInGroupIntentBuilderandFlutterFragment.withNewEngineInGroup(String)for related APIs.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Removes allFlutterEngineGroup's that are currently in the cache.booleancontains(String engineGroupId)FlutterEngineGroupget(String engineGroupId)Returns theFlutterEngineGroupin this cache that is associated with the givenengineGroupId, ornullis no suchFlutterEngineGroupexists.static FlutterEngineGroupCachegetInstance()Returns the static singleton instance ofFlutterEngineGroupCache.voidput(String engineGroupId, FlutterEngineGroup engineGroup)Places the givenFlutterEngineGroupin this cache and associates it with the givenengineGroupId.voidremove(String engineGroupId)Removes anyFlutterEngineGroupthat is currently in the cache that is identified by the givenengineGroupId.
-
-
-
Method Detail
-
getInstance
@NonNull public static FlutterEngineGroupCache getInstance()
Returns the static singleton instance ofFlutterEngineGroupCache.Creates a new instance if one does not yet exist.
-
contains
public boolean contains(@NonNull String engineGroupId)
-
get
@Nullable public FlutterEngineGroup get(@NonNull String engineGroupId)
Returns theFlutterEngineGroupin this cache that is associated with the givenengineGroupId, ornullis no suchFlutterEngineGroupexists.
-
put
public void put(@NonNull String engineGroupId, @Nullable FlutterEngineGroup engineGroup)Places the givenFlutterEngineGroupin this cache and associates it with the givenengineGroupId.If a
FlutterEngineGroupis null, thatFlutterEngineGroupis removed from this cache.
-
remove
public void remove(@NonNull String engineGroupId)Removes anyFlutterEngineGroupthat is currently in the cache that is identified by the givenengineGroupId.
-
clear
public void clear()
Removes allFlutterEngineGroup's that are currently in the cache.
-
-