From: James Procter Date: Thu, 23 Feb 2023 12:24:39 +0000 (+0000) Subject: JAL-4134 tidied up refactoring and fix compilation errrors X-Git-Tag: Release_2_11_3_0~15^2^2~33 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6ae908d9a0e2fb6daee16f88cf862525ede5b7cf;p=jalview.git JAL-4134 tidied up refactoring and fix compilation errrors --- diff --git a/src/jalview/datamodel/BinaryNode.java b/src/jalview/datamodel/BinaryNode.java index 6d392d4..5b55594 100755 --- a/src/jalview/datamodel/BinaryNode.java +++ b/src/jalview/datamodel/BinaryNode.java @@ -40,7 +40,7 @@ public class BinaryNode BinaryNode parent; - /** DOCUMENT ME!! */ + /** Bootstrap value */ public int bootstrap; /** DOCUMENT ME!! */ @@ -68,6 +68,7 @@ public class BinaryNode { left = right = parent = null; bootstrap = 0; + dist = 0; } /** @@ -80,13 +81,28 @@ public class BinaryNode * @param name * DOCUMENT ME! */ - public BinaryNode(Object element, BinaryNode parent, String name) + public BinaryNode(Object element, BinaryNode parent, String name, + double dist) { + this(); this.element = element; this.parent = parent; this.name = name; + this.dist = dist; + } + + public BinaryNode(Object element, BinaryNode parent, String name, + double dist, int bootstrap) + { + this(element, parent, name, dist); + this.bootstrap = bootstrap; + } - left = right = null; + public BinaryNode(Object val, BinaryNode parent, String name, double dist, + int bootstrap, boolean dummy) + { + this(val, parent, name, dist, bootstrap); + this.dummy = dummy; } /** @@ -322,18 +338,43 @@ public class BinaryNode } /** + * @param dummy + * true if node is created for the representation of polytomous trees + */ + public boolean isDummy() + { + return dummy; + } + + /** + * DOCUMENT ME! + * + * @param newstate + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public boolean setDummy(boolean newstate) + { + boolean oldstate = dummy; + dummy = newstate; + + return oldstate; + } + + /** * ascends the tree but doesn't stop until a non-dummy node is discovered. * */ public BinaryNode AscendTree() { BinaryNode c = this; - + do { c = c.parent(); } while ((c != null) && c.dummy); - + return c; } } diff --git a/src/jalview/datamodel/SequenceNode.java b/src/jalview/datamodel/SequenceNode.java index 30179f5..010d4aa 100755 --- a/src/jalview/datamodel/SequenceNode.java +++ b/src/jalview/datamodel/SequenceNode.java @@ -38,57 +38,22 @@ public class SequenceNode extends BinaryNode super(); } - /** - * Creates a new SequenceNode object. - * - * @param val - * DOCUMENT ME! - * @param parent - * DOCUMENT ME! - * @param dist - * DOCUMENT ME! - * @param name - * DOCUMENT ME! - */ - public SequenceNode(Object val, BinaryNode parent, double dist, - String name) + public SequenceNode(SequenceI val, BinaryNode parent, String name, + double dist, int bootstrap, boolean dummy) { - super(val, parent, name); - this.dist = dist; + super(val, parent, name, dist, bootstrap, dummy); } - /** - * Creates a new SequenceNode object. - * - * @param val - * DOCUMENT ME! - * @param parent - * DOCUMENT ME! - * @param name - * DOCUMENT ME! - * @param dist - * DOCUMENT ME! - * @param bootstrap - * DOCUMENT ME! - * @param dummy - * DOCUMENT ME! - */ - public SequenceNode(Object val, BinaryNode parent, String name, - double dist, int bootstrap, boolean dummy) + public SequenceNode(SequenceI element, BinaryNode parent, String name, + double dist, int bootstrap) { - super(val, parent, name); - this.dist = dist; - this.bootstrap = bootstrap; - this.dummy = dummy; + super(element, parent, name, dist, bootstrap); } - /** - * @param dummy - * true if node is created for the representation of polytomous trees - */ - public boolean isDummy() + public SequenceNode(SequenceI element, BinaryNode parent, String name, + double dist) { - return dummy; + super(element, parent, name, dist); } /* @@ -103,22 +68,6 @@ public class SequenceNode extends BinaryNode /** * DOCUMENT ME! * - * @param newstate - * DOCUMENT ME! - * - * @return DOCUMENT ME! - */ - public boolean setDummy(boolean newstate) - { - boolean oldstate = dummy; - dummy = newstate; - - return oldstate; - } - - /** - * DOCUMENT ME! - * * @param Placeholder * DOCUMENT ME! */