Package com.yahoo.document.select.rule
Class ComparisonNode
- java.lang.Object
-
- com.yahoo.document.select.rule.ComparisonNode
-
- All Implemented Interfaces:
ExpressionNode
public class ComparisonNode extends Object implements ExpressionNode
- Author:
- Simon Thoresen Hult
-
-
Constructor Summary
Constructors Constructor Description ComparisonNode(ExpressionNode lhs, String operator, ExpressionNode rhs)
Constructs a new comparison node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(Visitor visitor)
Perform visitation of this node.Object
evaluate(Context context)
Evaluate the content of this node based on document object, and return that value.BucketSet
getBucketSet(BucketIdFactory factory)
Returns the set of bucket ids covered by this node.ExpressionNode
getLHS()
Returns the left hand side of this comparison.String
getOperator()
Returns the comparison operator of this.ExpressionNode
getRHS()
Returns the right hand side of this comparison.ComparisonNode
setOperator(String operator)
Sets the comparison operator of this.String
toString()
-
-
-
Constructor Detail
-
ComparisonNode
public ComparisonNode(ExpressionNode lhs, String operator, ExpressionNode rhs)
Constructs a new comparison node.- Parameters:
lhs
- The left-hand-side of the comparison.operator
- The comparison operator.rhs
- The right-hand-side of the comparison.
-
-
Method Detail
-
getLHS
public ExpressionNode getLHS()
Returns the left hand side of this comparison.- Returns:
- The left hand side expression.
-
getOperator
public String getOperator()
Returns the comparison operator of this.- Returns:
- The operator.
-
setOperator
public ComparisonNode setOperator(String operator)
Sets the comparison operator of this.- Parameters:
operator
- The operator string.- Returns:
- This, to allow chaining.
-
getRHS
public ExpressionNode getRHS()
Returns the right hand side of this comparison.- Returns:
- The right hand side expression.
-
getBucketSet
public BucketSet getBucketSet(BucketIdFactory factory)
Description copied from interface:ExpressionNode
Returns the set of bucket ids covered by this node.- Specified by:
getBucketSet
in interfaceExpressionNode
- Parameters:
factory
- the factory used by the current application
-
evaluate
public Object evaluate(Context context)
Description copied from interface:ExpressionNode
Evaluate the content of this node based on document object, and return that value.- Specified by:
evaluate
in interfaceExpressionNode
- Parameters:
context
- the document to evaluate over- Returns:
- the value of this
-
accept
public void accept(Visitor visitor)
Description copied from interface:ExpressionNode
Perform visitation of this node.- Specified by:
accept
in interfaceExpressionNode
- Parameters:
visitor
- the visitor that wishes to visit the node
-
-