public abstract class CoreOperation extends Operation
Expression.PointerIterator, Expression.ValueIterator
Modifier and Type | Field and Description |
---|---|
protected static int |
ADD_PRECEDENCE
add/subtract precedence
|
protected static int |
AND_PRECEDENCE
and precedence
|
protected static int |
COMPARE_PRECEDENCE
compare precedence
|
protected static int |
MULTIPLY_PRECEDENCE
multiply/divide/mod precedence
|
protected static int |
NEGATE_PRECEDENCE
negate precedence
|
protected static int |
OR_PRECEDENCE
or precedence
|
protected static int |
RELATIONAL_EXPR_PRECEDENCE
relational expression precedence
|
protected static int |
UNION_PRECEDENCE
union precedence
|
NOT_A_NUMBER, ONE, ZERO
Constructor and Description |
---|
CoreOperation(Expression[] args)
Create a new CoreOperation.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
compute(EvalContext context)
Evaluates the expression.
|
abstract java.lang.Object |
computeValue(EvalContext context)
Evaluates the expression.
|
protected abstract int |
getPrecedence()
Computes the precedence of the operation.
|
abstract java.lang.String |
getSymbol()
Returns the XPath symbol for this operation, e.g.
|
protected abstract boolean |
isSymmetric()
Returns true if the operation is not sensitive to the order of arguments,
e.g.
|
private java.lang.String |
parenthesize(Expression expression,
boolean left)
Wrap an expression in parens if necessary.
|
java.lang.String |
toString() |
computeContextDependent, getArguments
isContextDependent, iterate, iteratePointers
protected static final int OR_PRECEDENCE
protected static final int AND_PRECEDENCE
protected static final int COMPARE_PRECEDENCE
protected static final int RELATIONAL_EXPR_PRECEDENCE
protected static final int ADD_PRECEDENCE
protected static final int MULTIPLY_PRECEDENCE
protected static final int NEGATE_PRECEDENCE
protected static final int UNION_PRECEDENCE
public CoreOperation(Expression[] args)
args
- Expression[]public java.lang.Object compute(EvalContext context)
Expression
compute
in class Expression
context
- evaluation contextpublic abstract java.lang.Object computeValue(EvalContext context)
Expression
computeValue
in class Expression
context
- evaluation contextpublic abstract java.lang.String getSymbol()
protected abstract boolean isSymmetric()
protected abstract int getPrecedence()
public java.lang.String toString()
toString
in class java.lang.Object
private java.lang.String parenthesize(Expression expression, boolean left)
expression
- other Expressionleft
- whether expression
is left of this one.