jd.xml.xpath.expr.operator
Class NumericOperator

java.lang.Object
  extended byjd.xml.xpath.expr.ExpressionImpl
      extended byjd.xml.xpath.expr.NumericExpression
          extended byjd.xml.xpath.expr.operator.NumericOperator
All Implemented Interfaces:
Expression, Operator
Direct Known Subclasses:
Add, Divide, Modulo, Multiply, Subtract

public abstract class NumericOperator
extends NumericExpression
implements Operator

NumericOperator is a base class for numeric operations.


Field Summary
protected  Expression lhs_
           
protected  Expression rhs_
           
 
Fields inherited from interface jd.xml.xpath.expr.Expression
DEP_CONTEXT_NODE, DEP_CONTEXT_POSITION, DEP_CONTEXT_SIZE, DEP_CONTEXT_STATIC, DEP_NONE, DEP_UNKNOWN
 
Constructor Summary
NumericOperator(Expression lhs, Expression rhs)
          Create a NumericExpression.
 
Method Summary
 int getContextDependencies()
          Return a bitfield indicating the expression dependencies on the XPath context.
protected abstract  double toNumberValue(double n1, double n2)
          Evaluate the expression.
 double toNumberValue(XPathContext context)
          Evaluate the Expression to a number.
 
Methods inherited from class jd.xml.xpath.expr.NumericExpression
getResultType, toBooleanValue, toStringValue, toXObject
 
Methods inherited from class jd.xml.xpath.expr.ExpressionImpl
hasContextDependencies, isUniqueFilter, matchesFilter, toNode, toNodeSet, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jd.xml.xpath.expr.Expression
accept, getResultType, hasContextDependencies, isUniqueFilter, matchesFilter, toBooleanValue, toNode, toNodeSet, toString, toStringValue, toXObject
 

Field Detail

lhs_

protected final Expression lhs_

rhs_

protected final Expression rhs_
Constructor Detail

NumericOperator

public NumericOperator(Expression lhs,
                       Expression rhs)
Create a NumericExpression.

Method Detail

getContextDependencies

public int getContextDependencies()
Description copied from interface: Expression
Return a bitfield indicating the expression dependencies on the XPath context.

Specified by:
getContextDependencies in interface Expression

toNumberValue

public double toNumberValue(XPathContext context)
Description copied from interface: Expression
Evaluate the Expression to a number.

Specified by:
toNumberValue in interface Expression
Specified by:
toNumberValue in class NumericExpression

toNumberValue

protected abstract double toNumberValue(double n1,
                                        double n2)
Evaluate the expression.