TimedLruCache<K, V> class
带过期时间的 LRU 缓存
缓存项在指定时间后自动过期。
Constructors
- TimedLruCache({required int maxSize, required Duration expiration})
Properties
- expiration → Duration
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- length → int
-
获取当前缓存大小
no setter
- maxSize → int
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
) → void - 清空缓存
-
get(
K key) → V? - 获取缓存数据(过期数据返回 null)
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
put(
K key, V value) → void - 存入缓存数据
-
remove(
K key) → V? - 移除指定 key
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited