Package io.flutter.embedding.engine
Class FlutterEngineGroupCache
java.lang.Object
io.flutter.embedding.engine.FlutterEngineGroupCache
Static singleton cache that holds
FlutterEngineGroup
instances identified by Strings.
The ID of a given FlutterEngineGroup can be whatever
String is desired.
FlutterActivity and FlutterFragment use the FlutterEngineGroupCache singleton
internally when instructed to use a cached FlutterEngineGroup
based on a given ID. See FlutterActivity.NewEngineInGroupIntentBuilder and FlutterFragment.withNewEngineInGroup(String) for related APIs.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes allFlutterEngineGroup's that are currently in the cache.booleanReturns theFlutterEngineGroupin this cache that is associated with the givenengineGroupId, ornullis no suchFlutterEngineGroupexists.static FlutterEngineGroupCacheReturns the static singleton instance ofFlutterEngineGroupCache.voidput(String engineGroupId, FlutterEngineGroup engineGroup) Places the givenFlutterEngineGroupin this cache and associates it with the givenengineGroupId.voidRemoves anyFlutterEngineGroupthat is currently in the cache that is identified by the givenengineGroupId.
-
Method Details
-
getInstance
Returns the static singleton instance ofFlutterEngineGroupCache.Creates a new instance if one does not yet exist.
-
contains
-
get
Returns theFlutterEngineGroupin this cache that is associated with the givenengineGroupId, ornullis no suchFlutterEngineGroupexists. -
put
Places the givenFlutterEngineGroupin this cache and associates it with the givenengineGroupId.If a
FlutterEngineGroupis null, thatFlutterEngineGroupis removed from this cache. -
remove
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.
-