Cache<I, O, C> class
Stores a map of inputs and outputs.
Constructors
- Cache(O _generator(I), {required C sanitizer(I)})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
calculate(
I input) → O -
Returns the output for a given
input
without storing it in the cache. -
call(
I input) → O -
If the sanitized
input
is in the cache, it will return the corresponding output. If it isn't, it will calculate the appropriate output and then cache it. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
recalculate(
I input) → O -
If an output for an
input
isn't valid anymore, usually because of a state change, this method can be used to recalculate an output for a giveninput
. If you don't want to store the result in the cache, the better method to use would be calculate. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited