Cache<S extends Storage<C, K, V>, C extends CacheEntry<K, V>, K extends Comparable, V extends Object?> class abstract

Implementers

Constructors

Cache({required S storage, OnEvict<K, V>? onEvict, Duration? expiration})

Properties

entries List<C>
no setter
expiration Duration
no getter
hashCode int
The hash code for this object.
no setterinherited
length int
return the number of element in the cache
no setter
loader LoaderFunc<K, V>
no getter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
storage ← S
no getter
syncLoading bool
no getter

Methods

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