Memoized<V> class
Represents a memoization wrapper for a computation that returns a value of type V
.
This class is used to cache and manage the result of a computation so it doesn't need to be recomputed unless explicitly told to or if it's marked as expired.
Constructors
- Memoized(V _computation())
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isComputed → bool
-
Check if the memoized value is successfully computed.
no setter
- isExpired → bool
-
Check if the memoized value is expired.
no setter
- isNotComputedYet → bool
-
Check if the memoized value is not computed yet.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
call(
{bool shouldUpdate = false}) → V - Calls the wrapped computation and returns the cached value.
-
expire(
) → void - Marks the cached value as expired, so the next call will trigger a recomputation.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited