3 % trees together and creates
new leaf elements out of the leafs of the two
7 % restriction to special IDs of the trees.
8 idsearch = {
'id1',
'id2'};
12 %
transient boolean specifying whether we are in the first (left) tree.
15 % a handle of type
DataTreeINode holding the right tree.
18 % last travelled node of type
DataTreeLeafNode in the left tree.
26 % constructor of this dummy test example class merging two trees.
29 % idsearch: a cell array of IDs to restrict the created trees to these
32 dmtc.idsearch = idsearch;
36 function tree = merge(this, left_tree, right_tree)
37 % function tree = merge(this, left_tree, right_tree)
38 % main entry function. This merges a left and a right tree and returns
47 this.in_left_tree = true;
48 this.right_tree = right_tree;
49 tree = create_tree(left_tree, this, [], [], [], []);
52 function node = create_leaf_node(this, arg_node, basepath, mu_cube, tslice)
53 % function node = create_leaf_node(this, arg_node, basepath, mu_cube, tslice)
56 % This method expects leafs storing strings and creates new strings with
57 % content '[left_string, '''' + '''', right_string]' out of it.
61 this.leftnode = arg_node;
62 this.in_left_tree = false;
63 node = create_tree(this.right_tree,...
65 this.idsearch, mu_cube, tslice,...
67 this.in_left_tree = true;
70 newval = [num2str(this.leftnode.value), '+', num2str(arg_node.value)];
a test implementation of an DataTree.ICreator that actually merges two trees together and creates ne...
Dummy implementation for a DataTree.ILeafNode that stores a single data.
interface for a class used to create a new (sub-)tree from an old one with the DataTree.INode.creat...
Interface for a node in a DataTree.
default implementation of the DataTree.ICreator interface