Package com.yahoo.searchlib.treenet.rule
Class Tree
- java.lang.Object
-
- com.yahoo.searchlib.treenet.rule.Tree
-
public class Tree extends java.lang.Object
- Author:
- Simon Thoresen Hult
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getBegin()
Returns the id of the first condition or response to run in this tree.java.lang.String
getName()
java.lang.String
getNext()
Returns the id of the next tree to run after this.java.util.Map<java.lang.String,TreeNode>
getNodes()
Returns all named nodes of this tree.TreeNet
getParent()
Returns the parent tree net of this.java.lang.Double
getValue()
Returns the initial response value of this tree, may be null.Tree
setParent(TreeNet parent)
Sets the parent tree net of this.java.lang.String
toRankingExpression()
Returns a ranking expression equivalent of this tree.
-
-
-
Constructor Detail
-
Tree
public Tree(java.lang.String name, java.lang.Double value, java.lang.String begin, java.util.Map<java.lang.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 java.lang.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 java.lang.String getNext()
Returns the id of the next tree to run after this.
-
getValue
public java.lang.Double getValue()
Returns the initial response value of this tree, may be null.
-
getBegin
public java.lang.String getBegin()
Returns the id of the first condition or response to run in this tree.
-
getNodes
public java.util.Map<java.lang.String,TreeNode> getNodes()
Returns all named nodes of this tree.
-
toRankingExpression
public java.lang.String toRankingExpression()
Returns a ranking expression equivalent of this tree.
-
-