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
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應