LRUCache<TKey,TValue> 类

定义

最近使用最少的缓存,像字典一样存储。

public sealed class LRUCache<TKey,TValue>
type LRUCache<'Key, 'Value> = class
Public NotInheritable Class LRUCache(Of TKey, TValue)

类型参数

TKey

缓存项的键的类型。

TValue

缓存项的类型。

继承
LRUCache<TKey,TValue>

构造函数

LRUCache<TKey,TValue>()

初始化 LRUCache<TKey,TValue> 类的新实例。

LRUCache<TKey,TValue>(Int32)

初始化 LRUCache<TKey,TValue> 类的新实例。

方法

Set(TKey, TValue)

将指定的键和值添加到缓存。

TryGet(TKey, TValue)

获取与指定键关联的值。

适用于