1 classdef DummyMerger < DataTree.CreatorDefault
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 DataTree.INode holding the right tree.
18 % last travelled node of type DataTree.LeafNode 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
42 % left_tree: left tree of type DataTree.
INode
43 % right_tree: right tree of type DataTree.
INode
46 % tree: merged tree of type DataTree.
INode
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.
59 % @copydetails DataTree::
ICreatorcreate_leaf_node()
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)];