SimpleCache<K, V> class

SimpleCache is a basic cache implementation without any particular logic than appending keys in the storage, and remove first inserted keys when storage is full

Inheritance
Implementers

Constructors

SimpleCache({required Storage<K, V> storage, OnEvict<K, V>? onEvict})

Properties

expiration Duration
no getterinherited
hashCode int
The hash code for this object.
no setterinherited
length int
return the number of element in the cache
no setteroverride
loader LoaderFunc<K, V>
no getterinherited
onEvict OnEvict<K, V>?
if onEvict is set that method is called whenever an entry is removed from the queue. At the time the method is called the entry is already removed.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
storage Storage<K, V>
no getterinherited
syncLoading bool
no getterinherited

Methods

clear() SimpleCache<K, V>
remove all the entry inside the cache
override
containsKey(K key) bool
inherited
get(K key) → V?
return the element identify by key
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
set(K key, V element) Cache<K, V>
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) → V?
return the value at key
inherited
operator []=(K key, V element) → void
assign element for key
inherited