4 % This
class implements the methods get(), get_index(), set() and
8 % cell array of
DataTree.
INode elements, holding the childrens of
this
14 function data =
get(
this, index)
15 %
function data =
get(
this, index)
20 data = get(this.values{index(1)}, index(2:end));
21 elseif length(index) == 1
22 data = this.values{index};
28 function path = get_index(
this,
id, mu, nt)
29 %
function path = get_index(
this,
id, mu, nt)
33 path = get_index(this,
id, mu, nt);
35 path = [path, get_path_index(this.values{path}, id, mu, nt)];
39 function children = length(
this)
40 %
function children = length(
this)
44 children = length(this.values);
47 function this = set(this, index, value)
48 % function this = set(this, index, value)
53 set(this.values{index(1)}, index(2:end), value);
54 elseif length(index) == 1
55 this.values{index} = value;
Interface for a node in a DataTree.
virtual function index = get_index(id, mu, nt)
Obtains the leaf index vector that best fits the child description given by the three arguments...
virtual function INode data = get(index)
Access to a child of the current node.
virtual function children = length()
Returns the number of children of the node.