Cache<K, V> class
abstract
The interace for the cache
- Implementers
Properties
- capacity → int
-
The maximum capacity of the cache. When more values will be added to the
cache the least "desired" values will be removed. "desired" values are
determined by the type of the cache. For example the lruCache will evict
the item wich was not used for the longest time.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- length → int
-
return the number of element 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 - remove all the entry inside the cache and evicts all entries
-
containsKey(
K key) → bool - Check if the cache contains a specific entry. It is better to use get and check for null-returns
-
get(
K key) → V? -
return the element identified by
key
or null if the key is not found. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
K key) → V? - Removes an entry from the cache. Returns null if the entry was not found. Note that the entry which may be returned is already evicted.
-
set(
K key, V element) → void -
add
element
in the cache atkey
and eventually deletes an old item -
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
. Same as get -
operator []=(
K key, V element) → void -
assign
element
forkey
. Same as set