語言

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>

建構函式

名稱 Description
LRUCache<TKey,TValue>()

初始化 LRUCache<TKey,TValue> 類別的新執行個體。

LRUCache<TKey,TValue>(Int32)

初始化 LRUCache<TKey,TValue> 類別的新執行個體。

方法

名稱 Description
Set(TKey, TValue)

將指定的鍵值加入快取。

TryGet(TKey, TValue)

取得與指定索引鍵相關聯的值。

適用於