LRUCache<TKey,TValue> LRUCache<TKey,TValue> Class

Definition

Implements a Least Recently Used Cache

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

Type Parameters

TKey

The type of key for the LRU cache.

TValue

The type for the values of the LRU cache.

Inheritance
LRUCache<TKey,TValue>LRUCache<TKey,TValue>

Constructors

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

Constructs a new instance of the LRU cache with a limit based on the number of slots in the cache.

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

Constructs a new instance of the LRU cache with a limit based on the number of slots and a memory size limit.

Properties

Item[TKey] Item[TKey]

Retrieves or sets value in the LRU cache

Methods

Purge() Purge()

Purges the cache, and calls Dispose on all of the elements of the cache.

ToString() ToString()

Applies to