LRUCache<TKey,TValue> 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
一個最近最少使用的快取,像字典一樣儲存。
public sealed class LRUCache<TKey,TValue>
type LRUCache<'Key, 'Value> = class
Public NotInheritable Class LRUCache(Of TKey, TValue)
類型參數
- TKey
快取項目的金鑰類型。
- TValue
快取項目的類型。
- 繼承
-
LRUCache<TKey,TValue>
建構函式
| 名稱 | Description |
|---|---|
| LRUCache<TKey,TValue>() |
初始化 LRUCache<TKey,TValue> 類別的新執行個體。 |
| LRUCache<TKey,TValue>(Int32) |
初始化 LRUCache<TKey,TValue> 類別的新執行個體。 |
方法
| 名稱 | Description |
|---|---|
| Set(TKey, TValue) |
將指定的鍵值加入快取。 |
| TryGet(TKey, TValue) |
取得與指定索引鍵相關聯的值。 |