MemoryInterface interface

Interface to parse a string into an Expression

Methods

getValue(string)

get value from a given path, it can be a simple indenfiter like "a", or a combined path like "a.b", "a.b[2]", "a.b[2].c", inside [] is guranteed to be a int number or a string.

setValue(string, any)

Set value to a given path.

version()

Version is used to identify whether the a particular memory instance has been updated or not. If version is not changed, the caller may choose to use the cached result instead of recomputing everything.

Method Details

getValue(string)

get value from a given path, it can be a simple indenfiter like "a", or a combined path like "a.b", "a.b[2]", "a.b[2].c", inside [] is guranteed to be a int number or a string.

function getValue(path: string): any

Parameters

path

string

memory path.

Returns

any

value.

setValue(string, any)

Set value to a given path.

function setValue(path: string, value: any)

Parameters

path

string

memory path.

value

any

value to set.

version()

Version is used to identify whether the a particular memory instance has been updated or not. If version is not changed, the caller may choose to use the cached result instead of recomputing everything.

function version(): string

Returns

string