Share via


LRUCache<TKey,TValue> Class

Definition

A least-recently-used cache stored like a dictionary.

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

Type Parameters

TKey

The type of the key to the cached item.

TValue

The type of the cached item.

Inheritance
LRUCache<TKey,TValue>

Constructors

LRUCache<TKey,TValue>()

Initializes a new instance of the LRUCache<TKey,TValue> class.

LRUCache<TKey,TValue>(Int32)

Initializes a new instance of the LRUCache<TKey,TValue> class.

Methods

Set(TKey, TValue)

Adds the specified key and value to the cache.

TryGet(TKey, TValue)

Gets the value associated with the specified key.

Applies to