Class Tree


  • public class Tree
    extends Object
    Author:
    Simon Thoresen Hult
    • Constructor Detail

      • Tree

        public Tree​(String name,
                    Double value,
                    String begin,
                    Map<String,​TreeNode> nodes)
        Constructs a new tree.
        Parameters:
        name - The name of this tree, used for error outputs.
        value - The initial response value of this tree, may be null.
        begin - The id of the first condition or response to run in this tree.
        nodes - All named nodes of this tree.
    • Method Detail

      • getName

        public String getName()
      • getParent

        public TreeNet getParent()
        Returns the parent tree net of this.
      • setParent

        public Tree setParent​(TreeNet parent)
        Sets the parent tree net of this.
        Parameters:
        parent - The parent tree net.
        Returns:
        This, to allow chaining.
      • getNext

        public String getNext()
        Returns the id of the next tree to run after this.
      • getValue

        public Double getValue()
        Returns the initial response value of this tree, may be null.
      • getBegin

        public String getBegin()
        Returns the id of the first condition or response to run in this tree.
      • getNodes

        public Map<String,​TreeNode> getNodes()
        Returns all named nodes of this tree.
      • toRankingExpression

        public String toRankingExpression()
        Returns a ranking expression equivalent of this tree.