MemoizedFunction<A, T> class

Class representing a memoized function requiring a single argument of type A and returning an object of type T.

Constructors

MemoizedFunction(SingleArgumentFunction<A, T> func, {Map<A, T> functionTable = const {}})
Constructs a instance of MemoizedFunction.

Properties

argumentType Type
Returns the function argument type A.
no setter
func SingleArgumentFunction<A, T>
Function being memoized.
final
functionTable Map<A, T>
Returns a copy of the current function table.
no setter
hashCode int
The hash code for this object.
no setterinherited
returnType Type
Returns the function return type T.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
signature Type
Returns the typedef of the memoized function.
no setter

Methods

call(A arg, {bool recalculate = false}) → T
Returns the result of calling func or a cached result if available.
clearFunctionTable({Iterable<A>? args}) → void
Clears the cached function table.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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