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:
Serializable
,Cloneable
- Direct Known Subclasses:
AggregationRefNode
,AggregationResult
,ConstantNode
,DocumentAccessorNode
,FunctionNode
,RelevanceNode
public abstract class ExpressionNode
extends com.yahoo.vespa.objects.Identifiable
implements 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:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
final boolean
protected abstract boolean
boolean
execute()
Execute expression.protected void
executeIterative
(ResultNode arg, ResultNode result) Give an argument to this expression and store the result.abstract ResultNode
Get the result of this expression.protected void
onArgument
(ResultNode arg, ResultNode result) protected void
onDeserialize
(com.yahoo.vespa.objects.Deserializer buf) protected boolean
protected int
protected void
protected void
onSerialize
(com.yahoo.vespa.objects.Serializer buf) void
prepare()
Prepare expression for execution.void
visitMembers
(com.yahoo.vespa.objects.ObjectVisitor visitor) Methods inherited from class com.yahoo.vespa.objects.Identifiable
create, createFromId, deserialize, deserializeOptional, deserializeWithId, equals, getClassId, getRawUtf8Bytes, getUtf8, hashCode, putUtf8, registerClass, registerClass, serialize, serializeOptional, serializeWithId, toString
Methods inherited from class com.yahoo.vespa.objects.Selectable
select, select, selectMembers
-
Field Details
-
classId
public static final int classId
-
-
Constructor Details
-
ExpressionNode
public ExpressionNode()
-
-
Method Details
-
prepare
public void prepare()Prepare expression for execution. -
execute
public boolean execute()Execute expression.- Returns:
- true if successful, false if not.
-
executeIterative
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
-
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
- Overrides:
clone
in classcom.yahoo.vespa.objects.Identifiable
-
equals
- Overrides:
equals
in classcom.yahoo.vespa.objects.Identifiable
-
equalsExpression
-
getResult
Get the result of this expression.- Returns:
- the result as a ResultNode.
-