LRUCache<TKey,TValue> 类

定义

实现最近最少使用的缓存

public class LRUCache<TKey,TValue> where TValue : class, IDisposable
type LRUCache<'Key, 'Value (requires 'Value : null and 'Value :> IDisposable)> = class

类型参数

TKey

LRU 缓存的密钥类型。

TValue

LRU 缓存的值的类型。

继承
LRUCache<TKey,TValue>

构造函数

LRUCache<TKey,TValue>(Int32)

根据缓存中的槽数使用限制构造 LRU 缓存的新实例。

LRUCache<TKey,TValue>(Int32, Int32, Func<TValue,Int32>)

使用基于槽数和内存大小限制的限制构造 LRU 缓存的新实例。

属性

Item[TKey]

检索或设置 LRU 缓存中的值

方法

Purge()

清除缓存,并在缓存的所有元素上调用 Dispose。

ToString()

适用于