Package | laya.utils |
Class | public class WeakObject |
Inheritance | WeakObject Object |
Property | Defined By | ||
---|---|---|---|
delInterval : int [static] 如果不支持WeakMap,则多少时间清理一次缓存,默认10分钟清理一次 | WeakObject | ||
I : WeakObject [static] 全局WeakObject单例 | WeakObject | ||
supportWeakMap : Boolean [static] 是否支持WeakMap | WeakObject |
Method | Defined By | ||
---|---|---|---|
WeakObject | |||
clearCache():void [static] 清理缓存,回收内存 | WeakObject | ||
del(key:Object):void
删除缓存
| WeakObject | ||
get(key:Object):*
获取缓存
| WeakObject | ||
has(key:Object):Boolean
是否有缓存
| WeakObject | ||
set(key:Object, value:Object):void
设置缓存
| WeakObject |
delInterval | property |
public static var delInterval:int
如果不支持WeakMap,则多少时间清理一次缓存,默认10分钟清理一次
I | property |
public static var I:WeakObject
全局WeakObject单例
supportWeakMap | property |
public static var supportWeakMap:Boolean
是否支持WeakMap
WeakObject | () | Constructor |
public function WeakObject()
clearCache | () | method |
public static function clearCache():void
清理缓存,回收内存
del | () | method |
public function del(key:Object):void
删除缓存
Parameters
key:Object |
get | () | method |
public function get(key:Object):*
获取缓存
Parameters
key:Object — kye对象,可被回收
|
* |
has | () | method |
public function has(key:Object):Boolean
是否有缓存
Parameters
key:Object |
Boolean |
set | () | method |
public function set(key:Object, value:Object):void
设置缓存
Parameters
key:Object — kye对象,可被回收
| |
value:Object — object对象,可被回收
|