Class LruCache<TKey, TValue>
/// LRU Cache with disposing of disposable values.
Inheritance
LruCache<TKey, TValue>
Assembly: Mapsui.dll
Syntax
public class LruCache<TKey, TValue> where TKey : notnull
Type Parameters
| Name |
Description |
| TKey |
|
| TValue |
|
Constructors
|
Edit this page
View Source
LruCache(int)
/// LRU Cache with disposing of disposable values.
Declaration
public LruCache(int capacity)
Parameters
| Type |
Name |
Description |
| int |
capacity |
|
Properties
|
Edit this page
View Source
this[TKey]
Declaration
public TValue this[TKey key] { get; set; }
Parameters
| Type |
Name |
Description |
| TKey |
key |
|
Property Value
Methods
|
Edit this page
View Source
Clear()
Declaration
|
Edit this page
View Source
Get(TKey)
Declaration
public TValue? Get(TKey key)
Parameters
| Type |
Name |
Description |
| TKey |
key |
|
Returns
|
Edit this page
View Source
GetOrCreateValue<TParam, TResult>(TParam, Func<TParam, TResult>)
Declaration
public TResult? GetOrCreateValue<TParam, TResult>(TParam key, Func<TParam, TResult> func) where TParam : TKey where TResult : TValue
Parameters
| Type |
Name |
Description |
| TParam |
key |
|
| Func<TParam, TResult> |
func |
|
Returns
Type Parameters
| Name |
Description |
| TParam |
|
| TResult |
|
|
Edit this page
View Source
Put(TKey, TValue)
Declaration
public void Put(TKey key, TValue value)
Parameters
| Type |
Name |
Description |
| TKey |
key |
|
| TValue |
value |
|
|
Edit this page
View Source
TryGetValue(TKey, out TValue)
Declaration
public bool TryGetValue(TKey key, out TValue value)
Parameters
| Type |
Name |
Description |
| TKey |
key |
|
| TValue |
value |
|
Returns
Extension Methods