- Preparing search index...
- The search index is not available
bruce-models
Class LRUCache<TKey, TValue>
Constructors
constructor
- new LRUCache<TKey, TValue>(capacity): LRUCache<TKey, TValue>
-
Returns LRUCache<TKey, TValue>
Properties
Private Readonly cache
cache: Map<TKey, TValue>
Private Readonly capacity
capacity: number
Methods
Clear
- Clear(): void
-
Returns void
Entries
- Entries(): IterableIterator<[TKey, TValue]>
-
Returns IterableIterator<[TKey, TValue]>
Get
- Get(key): TValue
-
Returns TValue
Set
- Set(key, value): void
-
Returns void
A simple LRU cache implementation. LRU cache is a cache that evicts the least recently used item when it is full.