Interface RootedTree

    • Method Detail

      • getChildren

        java.util.List<Node> getChildren​(Node node)
        Parameters:
        node - the node whose children are being requested.
        Returns:
        the list of nodes that are the children of the given node. The set may be empty for a terminal node (a tip).
      • getExternalNodeCount

        int getExternalNodeCount​(Node node)
      • getExternalNodes

        java.util.List<Node> getExternalNodes​(Node node)
        Parameters:
        node - the node whose external nodes are being requested.
        Returns:
        the list of external nodes descendent of the given node. The set may be empty for a terminal node (a tip).
      • hasHeights

        boolean hasHeights()
        Returns:
        Whether this tree has node heights available
      • isHeightsKnown

        boolean isHeightsKnown()
        Returns:
        Whether the node heights are known or need to be recalculated from the lengths
      • getHeight

        double getHeight​(Node node)
        Parameters:
        node - the node whose height is being requested.
        Returns:
        the height of the given node. The height will be less than the parent's height and greater than it children's heights.
      • hasLengths

        boolean hasLengths()
        Returns:
        Whether this tree has branch lengths available
      • isLengthsKnown

        boolean isLengthsKnown()
        Returns:
        Whether the branch lengths are known or need to be recalculated from the heights
      • getLength

        double getLength​(Node node)
        Parameters:
        node - the node whose branch length (to its parent) is being requested.
        Returns:
        the length of the branch to the parent node (0.0 if the node is the root).
      • getParent

        Node getParent​(Node node)
        Parameters:
        node - the node whose parent is requested
        Returns:
        the parent node of the given node, or null if the node is the root node.
      • getRootNode

        Node getRootNode()
        The root of the tree has the largest node height of all nodes in the tree.
        Returns:
        the root of the tree.
      • conceptuallyUnrooted

        boolean conceptuallyUnrooted()
        Due to current implementation limitations, trees store "branch" information in nodes. So, internally rooted trees are genetrated when un-rooted would be more natural. This should be removed. If this is a rooted tree then it is rooted. This can really only confuse things. Trees are unrooted, RootedTrees are rooted. This is not an implementation limitation. It may be that a RootedTree has an arbitrary root but it is still rooted. With a rooted tree, it is convenient to store branch information at the node (i.e., for the branch above the node) because there is no "branch" object. Andrew. This function will probably become deprecated once the "development" tree viewer becomes in sync with the main tree viewer branch and some method of handling this concept has been introduced. Until then, this method remains.
        Returns:
        true if tree(s) are to be viewed as unrooted
      • isRoot

        boolean isRoot​(Node node)
        Parameters:
        node - the node
        Returns:
        true if the node is the root of this tree.