LruCache<TKey,TValue> Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A simple LRU cache implementation using a doubly linked list and dictionary.
public class LruCache<TKey,TValue> : System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey,TValue>>
type LruCache<'Key, 'Value> = class
interface seq<KeyValuePair<'Key, 'Value>>
interface IEnumerable
Public Class LruCache(Of TKey, TValue)
Implements IEnumerable(Of KeyValuePair(Of TKey, TValue))
Type Parameters
- TKey
The type of key.
- TValue
The type of value.
- Inheritance
-
LruCache<TKey,TValue>
- Implements
-
IEnumerable<KeyValuePair<TKey,TValue>> IEnumerable
Constructors
LruCache<TKey,TValue>(Int32) |
Initializes a new instance of the LruCache<TKey,TValue> class. |
Properties
Count |
Gets the number of key/value pairs contained in the LruCache<TKey,TValue>. |
TotalLength |
Gets the total length of all values currently stored in the LruCache<TKey,TValue>. |
Methods
AddOrUpdate(TKey, TValue, Int32) |
Adds a key/value pair to the LruCache<TKey,TValue> if the key doesn't already exist, or updates a key/value pair in the LruCache<TKey,TValue> if the key does already exist. |
GetEnumerator() |
Returns an enumerator that iterates through the LruCache<TKey,TValue>. |
TryGet(TKey, TValue) |
Gets the value associated with the specified key. |
Explicit Interface Implementations
IEnumerable.GetEnumerator() |
Returns an enumerator that iterates through a collection. |
Applies to
Azure SDK for .NET
Váš názor
https://aka.ms/ContentUserFeedback.
Připravujeme: V průběhu roku 2024 budeme postupně vyřazovat problémy z GitHub coby mechanismus zpětné vazby pro obsah a nahrazovat ho novým systémem zpětné vazby. Další informace naleznete v tématu:Odeslat a zobrazit názory pro