Class ExpressionNode
java.lang.Object
com.yahoo.searchlib.rankingexpression.rule.ExpressionNode
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CompositeNode,ConstantNode,GBDTForestNode,GBDTNode,NameNode
Superclass of all expression nodes. Expression nodes have their identity determined by their content.
All expression nodes are immutable.
- Author:
- Simon Thoresen Hult
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanabstract ValueReturns the value of evaluating this expression over the given context.abstract inthashCode()Returns a hashcode computed from the data in thisfinal StringtoString()final StringBuildertoString(SerializationContext context) abstract StringBuildertoString(StringBuilder builder, SerializationContext context, Deque<String> path, CompositeNode parent) Returns this in serialized form.abstract com.yahoo.tensor.TensorTypeReturns the type this will return if evaluated with the given context.
-
Constructor Details
-
ExpressionNode
public ExpressionNode()
-
-
Method Details
-
toString
public abstract StringBuilder toString(StringBuilder builder, SerializationContext context, Deque<String> path, CompositeNode parent) Returns this in serialized form.- Parameters:
builder- the StringBuilder that will be appended tocontext- the serialization contextpath- the call path to this, used for cycle detection, or null if this is a rootparent- the parent node of this, or null if it is a root- Returns:
- the main script, referring to script instances.
-
type
public abstract com.yahoo.tensor.TensorType type(com.yahoo.tensor.evaluation.TypeContext<Reference> context) Returns the type this will return if evaluated with the given context.- Parameters:
context- the variable type bindings to use for this evaluation- Throws:
IllegalArgumentException- if there are variables which are not bound in the given map
-
evaluate
Returns the value of evaluating this expression over the given context.- Parameters:
context- the variable bindings to use for this evaluation- Throws:
IllegalArgumentException- if there are variables which are not bound in the given map
-
toString
-
equals
-
hashCode
public abstract int hashCode()Returns a hashcode computed from the data in this -
toString
-