MemoryCache<K, V> class

Simple class to cache values with size based eviction.

Constructors

MemoryCache({int cacheSize = 10})

Properties

cacheSize int
final
hashCode int
The hash code for this object.
no setterinherited
keys Iterable<K>
Iterates over all existing keys with values.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size int
Returns the number of values saved in this memory cache.
no setter

Methods

clear(K key) → void
Removes the value from the cache.
clearCache() → void
Removes all the values from the cache.
containsKey(K key) bool
Checks whether the cache has any value under key.
getValue(K key) → V?
Gets the value under key.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setValue(K key, V value) → void
Adds the value to the cache under key.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited