LRUCache<TKey,TValue> 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
實作最近使用最少的快取
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() | |