LruCache<K, V> class final

A simple Least Recently Used (LRU) cache implementation.

Keeps a fixed number of items (_maxSize). When the cache is full and a new item is added, the least recently used item is evicted. Accessing an item (get or update) marks it as the most recently used.

Implemented types

Constructors

LruCache(int _maxSize)
Creates an LRU cache with the specified maximum size.

Properties

hashCode → int
The hash code for this object.
no setterinherited
length → int
Returns the current number of items in the cache.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited
operator [](K key) → V?
Retrieves the value associated with key.
override
operator []=(K key, V value) → void
Associates value with key in the cache.
override