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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()final booleanprotected abstract booleanbooleanexecute()Execute expression.protected voidexecuteIterative(ResultNode arg, ResultNode result) Give an argument to this expression and store the result.abstract ResultNodeGet the result of this expression.protected voidonArgument(ResultNode arg, ResultNode result) protected voidonDeserialize(com.yahoo.vespa.objects.Deserializer buf) protected booleanprotected intprotected voidprotected voidonSerialize(com.yahoo.vespa.objects.Serializer buf) voidprepare()Prepare expression for execution.voidvisitMembers(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, serialize, serializeOptional, serializeWithId, toStringMethods 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:
onGetClassIdin classcom.yahoo.vespa.objects.Identifiable
-
onSerialize
protected void onSerialize(com.yahoo.vespa.objects.Serializer buf) - Overrides:
onSerializein classcom.yahoo.vespa.objects.Identifiable
-
onDeserialize
protected void onDeserialize(com.yahoo.vespa.objects.Deserializer buf) - Overrides:
onDeserializein classcom.yahoo.vespa.objects.Identifiable
-
visitMembers
public void visitMembers(com.yahoo.vespa.objects.ObjectVisitor visitor) - Overrides:
visitMembersin classcom.yahoo.vespa.objects.Identifiable
-
clone
- Overrides:
clonein classcom.yahoo.vespa.objects.Identifiable
-
equals
- Overrides:
equalsin classcom.yahoo.vespa.objects.Identifiable
-
equalsExpression
-
getResult
Get the result of this expression.- Returns:
- the result as a ResultNode.
-