1 Clazz.declarePackage ("jalview.datamodel");
\r
2 c$ = Clazz.decorateAsClass (function () {
\r
3 this.$element = null;
\r
9 Clazz.instantialize (this, arguments);
\r
10 }, jalview.datamodel, "BinaryNode");
\r
11 Clazz.makeConstructor (c$,
\r
13 this.$left = this.$right = this.$parent = null;
\r
16 Clazz.makeConstructor (c$,
\r
17 function (element, parent, name) {
\r
18 this.$element = element;
\r
19 this.$parent = parent;
\r
21 this.$left = this.$right = null;
\r
22 }, "~O,jalview.datamodel.BinaryNode,~S");
\r
23 Clazz.defineMethod (c$, "element",
\r
25 return this.$element;
\r
27 Clazz.defineMethod (c$, "setElement",
\r
29 return this.$element = v;
\r
31 Clazz.defineMethod (c$, "left",
\r
35 Clazz.defineMethod (c$, "setLeft",
\r
37 return this.$left = n;
\r
38 }, "jalview.datamodel.BinaryNode");
\r
39 Clazz.defineMethod (c$, "right",
\r
43 Clazz.defineMethod (c$, "setRight",
\r
45 return this.$right = n;
\r
46 }, "jalview.datamodel.BinaryNode");
\r
47 Clazz.defineMethod (c$, "parent",
\r
49 return this.$parent;
\r
51 Clazz.defineMethod (c$, "setParent",
\r
53 return this.$parent = n;
\r
54 }, "jalview.datamodel.BinaryNode");
\r
55 Clazz.defineMethod (c$, "isLeaf",
\r
57 return (this.$left == null) && (this.$right == null);
\r
59 Clazz.defineMethod (c$, "SetChildren",
\r
60 function (leftchild, rightchild) {
\r
61 if (leftchild != null) {
\r
62 this.setLeft (leftchild);
\r
63 leftchild.detach ();
\r
64 leftchild.setParent (this);
\r
65 }if (rightchild != null) {
\r
66 this.setRight (rightchild);
\r
67 rightchild.detach ();
\r
68 rightchild.setParent (this);
\r
69 }}, "jalview.datamodel.BinaryNode,jalview.datamodel.BinaryNode");
\r
70 Clazz.defineMethod (c$, "detach",
\r
72 if (this.$parent != null) {
\r
73 if (this.$parent.$left === this) {
\r
74 this.$parent.$left = null;
\r
76 if (this.$parent.$right === this) {
\r
77 this.$parent.$right = null;
\r
78 }}}this.$parent = null;
\r
81 Clazz.defineMethod (c$, "ascendLeft",
\r
86 } while ((c != null) && (c.left () != null) && !c.left ().isLeaf ());
\r
89 Clazz.defineMethod (c$, "ascendRight",
\r
94 } while ((c != null) && (c.right () != null) && !c.right ().isLeaf ());
\r
97 Clazz.defineMethod (c$, "setName",
\r
101 Clazz.defineMethod (c$, "getName",
\r
105 Clazz.defineMethod (c$, "setBootstrap",
\r
107 this.bootstrap = boot;
\r
109 Clazz.defineMethod (c$, "getBootstrap",
\r
111 return this.bootstrap;
\r