public class ArithmeticNode extends Object implements ExpressionNode
Modifier and Type | Class and Description |
---|---|
static class |
ArithmeticNode.NodeItem |
private class |
ArithmeticNode.ValueItem |
Modifier and Type | Field and Description |
---|---|
static int |
ADD |
static int |
DIV |
private List<ArithmeticNode.NodeItem> |
items |
static int |
MOD |
static int |
MUL |
static int |
NOP |
static int |
SUB |
Constructor and Description |
---|
ArithmeticNode() |
Modifier and Type | Method and Description |
---|---|
void |
accept(Visitor visitor)
Perform visitation of this node.
|
ArithmeticNode |
add(String operator,
ExpressionNode 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.
|
List<ArithmeticNode.NodeItem> |
getItems() |
OrderingSpecification |
getOrdering(int order)
If this document selection implies a specific ordering (using the orderdoc scheme),
return that specification.
|
String |
operatorToString(int operator) |
private void |
popOffTheTop(Stack<ArithmeticNode.ValueItem> buf) |
private int |
stringToOperator(String operator) |
String |
toString() |
public static final int NOP
public static final int ADD
public static final int SUB
public static final int MOD
public static final int DIV
public static final int MUL
private final List<ArithmeticNode.NodeItem> items
public ArithmeticNode add(String operator, ExpressionNode node)
public List<ArithmeticNode.NodeItem> getItems()
public BucketSet getBucketSet(BucketIdFactory factory)
ExpressionNode
getBucketSet
in interface ExpressionNode
factory
- The factory used by the current application.public Object evaluate(Context context)
ExpressionNode
evaluate
in interface ExpressionNode
context
- The document to evaluate over.private void popOffTheTop(Stack<ArithmeticNode.ValueItem> buf)
public String operatorToString(int operator)
private int stringToOperator(String operator)
public OrderingSpecification getOrdering(int order)
ExpressionNode
getOrdering
in interface ExpressionNode
order
- The order in which we are looking to traverse the ordering (ASCENDING or DESCENDING)public void accept(Visitor visitor)
ExpressionNode
accept
in interface ExpressionNode
visitor
- The visitor that wishes to visit the node.Copyright © 2018. All rights reserved.