X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fj2s%2Fjalview%2Fdatamodel%2FBinaryNode.js;h=7575508666bd8f608e067e45b36b681676e4c552;hp=64fb764696fc6a63db5e1518147428b667e0dbb5;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=8ffd05b3abe52c0b6b79b011c0966361f82d5fe6 diff --git a/site/j2s/jalview/datamodel/BinaryNode.js b/site/j2s/jalview/datamodel/BinaryNode.js index 64fb764..7575508 100644 --- a/site/j2s/jalview/datamodel/BinaryNode.js +++ b/site/j2s/jalview/datamodel/BinaryNode.js @@ -1,112 +1,112 @@ -Clazz.declarePackage ("jalview.datamodel"); -c$ = Clazz.decorateAsClass (function () { -this.$element = null; -this.name = null; -this.$left = null; -this.$right = null; -this.$parent = null; -this.bootstrap = 0; -Clazz.instantialize (this, arguments); -}, jalview.datamodel, "BinaryNode"); -Clazz.makeConstructor (c$, -function () { -this.$left = this.$right = this.$parent = null; -this.bootstrap = 0; -}); -Clazz.makeConstructor (c$, -function (element, parent, name) { -this.$element = element; -this.$parent = parent; -this.name = name; -this.$left = this.$right = null; -}, "~O,jalview.datamodel.BinaryNode,~S"); -Clazz.defineMethod (c$, "element", -function () { -return this.$element; -}); -Clazz.defineMethod (c$, "setElement", -function (v) { -return this.$element = v; -}, "~O"); -Clazz.defineMethod (c$, "left", -function () { -return this.$left; -}); -Clazz.defineMethod (c$, "setLeft", -function (n) { -return this.$left = n; -}, "jalview.datamodel.BinaryNode"); -Clazz.defineMethod (c$, "right", -function () { -return this.$right; -}); -Clazz.defineMethod (c$, "setRight", -function (n) { -return this.$right = n; -}, "jalview.datamodel.BinaryNode"); -Clazz.defineMethod (c$, "parent", -function () { -return this.$parent; -}); -Clazz.defineMethod (c$, "setParent", -function (n) { -return this.$parent = n; -}, "jalview.datamodel.BinaryNode"); -Clazz.defineMethod (c$, "isLeaf", -function () { -return (this.$left == null) && (this.$right == null); -}); -Clazz.defineMethod (c$, "SetChildren", -function (leftchild, rightchild) { -if (leftchild != null) { -this.setLeft (leftchild); -leftchild.detach (); -leftchild.setParent (this); -}if (rightchild != null) { -this.setRight (rightchild); -rightchild.detach (); -rightchild.setParent (this); -}}, "jalview.datamodel.BinaryNode,jalview.datamodel.BinaryNode"); -Clazz.defineMethod (c$, "detach", -function () { -if (this.$parent != null) { -if (this.$parent.$left === this) { -this.$parent.$left = null; -} else { -if (this.$parent.$right === this) { -this.$parent.$right = null; -}}}this.$parent = null; -return this; -}); -Clazz.defineMethod (c$, "ascendLeft", -function () { -var c = this; -do { -c = c.parent (); -} while ((c != null) && (c.left () != null) && !c.left ().isLeaf ()); -return c; -}); -Clazz.defineMethod (c$, "ascendRight", -function () { -var c = this; -do { -c = c.parent (); -} while ((c != null) && (c.right () != null) && !c.right ().isLeaf ()); -return c; -}); -Clazz.defineMethod (c$, "setName", -function (name) { -this.name = name; -}, "~S"); -Clazz.defineMethod (c$, "getName", -function () { -return this.name; -}); -Clazz.defineMethod (c$, "setBootstrap", -function (boot) { -this.bootstrap = boot; -}, "~N"); -Clazz.defineMethod (c$, "getBootstrap", -function () { -return this.bootstrap; -}); +Clazz.declarePackage ("jalview.datamodel"); +c$ = Clazz.decorateAsClass (function () { +this.$element = null; +this.name = null; +this.$left = null; +this.$right = null; +this.$parent = null; +this.bootstrap = 0; +Clazz.instantialize (this, arguments); +}, jalview.datamodel, "BinaryNode"); +Clazz.makeConstructor (c$, +function () { +this.$left = this.$right = this.$parent = null; +this.bootstrap = 0; +}); +Clazz.makeConstructor (c$, +function (element, parent, name) { +this.$element = element; +this.$parent = parent; +this.name = name; +this.$left = this.$right = null; +}, "~O,jalview.datamodel.BinaryNode,~S"); +Clazz.defineMethod (c$, "element", +function () { +return this.$element; +}); +Clazz.defineMethod (c$, "setElement", +function (v) { +return this.$element = v; +}, "~O"); +Clazz.defineMethod (c$, "left", +function () { +return this.$left; +}); +Clazz.defineMethod (c$, "setLeft", +function (n) { +return this.$left = n; +}, "jalview.datamodel.BinaryNode"); +Clazz.defineMethod (c$, "right", +function () { +return this.$right; +}); +Clazz.defineMethod (c$, "setRight", +function (n) { +return this.$right = n; +}, "jalview.datamodel.BinaryNode"); +Clazz.defineMethod (c$, "parent", +function () { +return this.$parent; +}); +Clazz.defineMethod (c$, "setParent", +function (n) { +return this.$parent = n; +}, "jalview.datamodel.BinaryNode"); +Clazz.defineMethod (c$, "isLeaf", +function () { +return (this.$left == null) && (this.$right == null); +}); +Clazz.defineMethod (c$, "SetChildren", +function (leftchild, rightchild) { +if (leftchild != null) { +this.setLeft (leftchild); +leftchild.detach (); +leftchild.setParent (this); +}if (rightchild != null) { +this.setRight (rightchild); +rightchild.detach (); +rightchild.setParent (this); +}}, "jalview.datamodel.BinaryNode,jalview.datamodel.BinaryNode"); +Clazz.defineMethod (c$, "detach", +function () { +if (this.$parent != null) { +if (this.$parent.$left === this) { +this.$parent.$left = null; +} else { +if (this.$parent.$right === this) { +this.$parent.$right = null; +}}}this.$parent = null; +return this; +}); +Clazz.defineMethod (c$, "ascendLeft", +function () { +var c = this; +do { +c = c.parent (); +} while ((c != null) && (c.left () != null) && !c.left ().isLeaf ()); +return c; +}); +Clazz.defineMethod (c$, "ascendRight", +function () { +var c = this; +do { +c = c.parent (); +} while ((c != null) && (c.right () != null) && !c.right ().isLeaf ()); +return c; +}); +Clazz.defineMethod (c$, "setName", +function (name) { +this.name = name; +}, "~S"); +Clazz.defineMethod (c$, "getName", +function () { +return this.name; +}); +Clazz.defineMethod (c$, "setBootstrap", +function (boot) { +this.bootstrap = boot; +}, "~N"); +Clazz.defineMethod (c$, "getBootstrap", +function () { +return this.bootstrap; +});