Class AbstractTree

    • Constructor Detail

      • AbstractTree

        public AbstractTree()
    • Method Detail

      • getParent

        public TreeNode getParent()
        Description copied from interface: TreeNode
        Get the parent of this node
        Specified by:
        getParent in interface TreeNode
        Returns:
        parent node
      • getChildren

        public List<TreeNode> getChildren()
        Description copied from interface: TreeNode
        Get all child nodes of this node
        Specified by:
        getChildren in interface TreeNode
        Returns:
        child nodes
      • getChild

        public TreeNode getChild​(int index)
        Description copied from interface: TreeNode
        Get child node by position in the list of siblings. The position depends on the order in which the children were added.
        Specified by:
        getChild in interface TreeNode
        Parameters:
        index - position in the list of siblings
        Returns:
        child node at position
      • isRoot

        public boolean isRoot()
        Description copied from interface: TreeNode
        Check whether this node is the root of the tree.
        Specified by:
        isRoot in interface TreeNode
        Returns:
        true if this node is the root
      • isChild

        public boolean isChild()
        Description copied from interface: TreeNode
        Check whether this node is a child node
        Specified by:
        isChild in interface TreeNode
        Returns:
        true if the node is a child of another node
      • isFirstSibling

        public boolean isFirstSibling()
        Description copied from interface: TreeNode
        Check whether a child is the first in the list of siblings
        Specified by:
        isFirstSibling in interface TreeNode
        Returns:
        true if the child is the first in the list of siblings
      • isSibling

        public boolean isSibling​(TreeNode node)
        Description copied from interface: TreeNode
        Check whether this node is a sibling of the second node.
        Specified by:
        isSibling in interface TreeNode
        Parameters:
        node - second node
        Returns:
        true if two nodes are siblings