LruCache<K, V> class

Inheritance

Constructors

LruCache({required Storage<K, V> storage, required int capacity})

Properties

capacity int
finalinherited
hashCode int
The hash code for this object.
no setterinherited
lastUse int
getter/setter pair
length int
return the number of element in the cache
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
storage Storage<K, V>
finalinherited

Methods

beforeGet(CacheEntry<K, V> entry) CacheEntry<K, V>?
clear() → void
remove all the entry inside the cache
inherited
containsKey(K key) bool
inherited
createCacheEntry(K key, V element) CacheEntry<K, V>
internal set
get(K key) → V?
return the element identified by key
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onCapacity(K key, V element) → void
called if the length of the map reaches the capacity and we want to insert another item into the map
remove(K key) → V?
inherited
set(K key, V element) → void
add element in the cache at key
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](K key) → dynamic
return the value at key
inherited
operator []=(K key, V element) → void
assign element for key
inherited