1 classdef DefaultNode < DataTree.INode
2 % Default implementation
for a DataTree.INode
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)
49 % @copybrief DataTree::
INodeset()
51 % @copydetails DataTree::
INodeset()
53 set(this.values{index(1)}, index(2:end), value);
54 elseif length(index) == 1
55 this.values{index} = value;