Storage<K, V> class
abstract
The abstract interface for a storage class
- Implementers
Constructors
- Storage()
Properties
-
entries
→ List<
CacheEntry< K, V> > -
Returns the available values. This violates the enclosing principle. Take
the return values with caution
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
keys
→ List<
K> -
Returns the available keys. This violates the enclosing principle. Take
the return values with caution
no setter
- length → int
-
Returns the approx number of items in the cache. Take this with a grain
of salt
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
) → void - Clears the cache, evicts all entries
-
containsKey(
K key) → bool - returns true if the item is available in the cache. Take this with a grain of salt since the item may be evicted before it will be retrieved. It is better to use get and check for null returns.
-
get(
K key) → CacheEntry< K, V> ? -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onCapacity(
K key) → CacheEntry< K, V> ? -
removes the entry denoted by
key
. This is called if the capacity is reached. -
remove(
K key) → CacheEntry< K, V> ? - removes the entry at position key. Returns the entry or null. Note that the entry is already evicted.
-
removeInternal(
K key) → CacheEntry< K, V> ? -
set(
K key, CacheEntry< K, V> value) → Storage -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
K key) → CacheEntry< K, V> ? - Same as get
-
operator []=(
K key, CacheEntry< K, V> value) → void - Same as set