Package com.yahoo.searchlib.expression
Class ExpressionNode
- java.lang.Object
-
- com.yahoo.vespa.objects.Selectable
-
- com.yahoo.vespa.objects.Identifiable
-
- com.yahoo.searchlib.expression.ExpressionNode
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
- Direct Known Subclasses:
AggregationRefNode
,AggregationResult
,ConstantNode
,DocumentAccessorNode
,FunctionNode
,RelevanceNode
public abstract class ExpressionNode extends com.yahoo.vespa.objects.Identifiable implements java.io.Serializable
This is the base class for all expression node types. There is no execution logic implemented in Java, since that all happens in the C++ backend. This class hierarchy is for building the expression tree to pass to the backend.- Author:
- baldersheim, Simon Thoresen Hult
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
classId
-
Constructor Summary
Constructors Constructor Description ExpressionNode()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ExpressionNode
clone()
boolean
equals(java.lang.Object obj)
protected abstract boolean
equalsExpression(ExpressionNode obj)
boolean
execute()
Execute expression.protected void
executeIterative(ResultNode arg, ResultNode result)
Give an argument to this expression and store the result.abstract ResultNode
getResult()
Get the result of this expression.protected void
onArgument(ResultNode arg, ResultNode result)
protected void
onDeserialize(com.yahoo.vespa.objects.Deserializer buf)
protected boolean
onExecute()
protected int
onGetClassId()
protected void
onPrepare()
protected void
onSerialize(com.yahoo.vespa.objects.Serializer buf)
void
prepare()
Prepare expression for execution.void
visitMembers(com.yahoo.vespa.objects.ObjectVisitor visitor)
-
-
-
Method Detail
-
prepare
public void prepare()
Prepare expression for execution.
-
execute
public boolean execute()
Execute expression.- Returns:
- true if successful, false if not.
-
executeIterative
protected void executeIterative(ResultNode arg, ResultNode result)
Give an argument to this expression and store the result.- Parameters:
arg
- Argument to use for expression.result
- Node to contain the result.
-
onExecute
protected boolean onExecute()
-
onPrepare
protected void onPrepare()
-
onArgument
protected void onArgument(ResultNode arg, ResultNode result)
-
onGetClassId
protected int onGetClassId()
- Overrides:
onGetClassId
in classcom.yahoo.vespa.objects.Identifiable
-
onSerialize
protected void onSerialize(com.yahoo.vespa.objects.Serializer buf)
- Overrides:
onSerialize
in classcom.yahoo.vespa.objects.Identifiable
-
onDeserialize
protected void onDeserialize(com.yahoo.vespa.objects.Deserializer buf)
- Overrides:
onDeserialize
in classcom.yahoo.vespa.objects.Identifiable
-
visitMembers
public void visitMembers(com.yahoo.vespa.objects.ObjectVisitor visitor)
- Overrides:
visitMembers
in classcom.yahoo.vespa.objects.Identifiable
-
clone
public ExpressionNode clone()
- Overrides:
clone
in classcom.yahoo.vespa.objects.Identifiable
-
equals
public final boolean equals(java.lang.Object obj)
- Overrides:
equals
in classcom.yahoo.vespa.objects.Identifiable
-
equalsExpression
protected abstract boolean equalsExpression(ExpressionNode obj)
-
getResult
public abstract ResultNode getResult()
Get the result of this expression.- Returns:
- the result as a ResultNode.
-
-