ResourceHolder
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
公共方法
public abstract void destroyAllResources ()
public abstract long
reclaimReleasedResources
()
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2022-09-26。
[null,null,["最后更新时间 (UTC):2022-09-26。"],[[["\u003cp\u003e\u003ccode\u003eResourceHolder\u003c/code\u003e is an interface that manages the lifecycle of resources, often used for pooling or caching.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to destroy all resources (\u003ccode\u003edestroyAllResources\u003c/code\u003e) and reclaim released resources (\u003ccode\u003ereclaimReleasedResources\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ereclaimReleasedResources\u003c/code\u003e disposes of garbage collected objects and returns the count of resources still in use.\u003c/p\u003e\n"]]],["`ResourceHolder` manages resources, offering methods to handle their lifecycle. `destroyAllResources` forces the disposal of all associated resources, disregarding any existing reference counts. `reclaimReleasedResources` checks for garbage-collected objects and releases their associated data, returning the count of resources currently in use. A related class, `CleanupRegistry`, maintains a queue and triggers a `Runnable` when objects are garbage-collected. These features manage resource lifecycle and garbage collection within the system.\n"],null,["# ResourceHolder\n\npublic interface **ResourceHolder** \n\n|---|---|---|\n| Known Indirect Subclasses [CleanupRegistry](/sceneform/reference/com/google/ar/sceneform/rendering/CleanupRegistry)\\\u003cT\\\u003e |------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [CleanupRegistry](/sceneform/reference/com/google/ar/sceneform/rendering/CleanupRegistry)\\\u003cT\\\u003e | Maintains a [ReferenceQueue](https://developer.android.com/reference/java/lang/ref/ReferenceQueue) and executes a [Runnable](https://developer.android.com/reference/java/lang/Runnable) after each object in the queue is garbage collected. | |||\n\nPool or cachce for resources \n\n### Public Methods\n\n|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract void | [destroyAllResources](/sceneform/reference/com/google/ar/sceneform/resources/ResourceHolder#destroyAllResources())() Ignores reference count and disposes any associated resources. |\n| abstract long | [reclaimReleasedResources](/sceneform/reference/com/google/ar/sceneform/resources/ResourceHolder#reclaimReleasedResources())() Polls for garbage collected objects and disposes associated data. |\n\nPublic Methods\n--------------\n\n#### public abstract void\n**destroyAllResources**\n()\n\nIgnores reference count and disposes any associated resources. \n\n#### public abstract long\n**reclaimReleasedResources**\n()\n\nPolls for garbage collected objects and disposes associated data. \n\n##### Returns\n\n- Count of resources in use."]]