org.apache.commons.jxpath.ri.compiler

Class CoreOperation

Known Direct Subclasses:
CoreOperationAdd, CoreOperationAnd, CoreOperationCompare, CoreOperationDivide, CoreOperationGreaterThan, CoreOperationGreaterThanOrEqual, CoreOperationLessThan, CoreOperationLessThanOrEqual, CoreOperationMod, CoreOperationMultiply, CoreOperationNegate, CoreOperationOr, CoreOperationSubtract, CoreOperationUnion

public abstract class CoreOperation
extends Operation

The common subclass for tree elements representing core operations like "+", "- ", "*" etc.
Version:
$Revision: 1.14 $ $Date: 2004/02/29 14:17:39 $
Author:
Dmitri Plotnikov

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.commons.jxpath.ri.compiler.Expression

Expression.PointerIterator, Expression.ValueIterator

Field Summary

Fields inherited from class org.apache.commons.jxpath.ri.compiler.Operation

args

Fields inherited from class org.apache.commons.jxpath.ri.compiler.Expression

NOT_A_NUMBER, ONE, ZERO

Constructor Summary

CoreOperation(args[] )

Method Summary

Object
compute(EvalContext context)
abstract Object
computeValue(EvalContext context)
protected abstract int
getPrecedence()
Computes the precedence of the operation.
abstract 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.
String
toString()

Methods inherited from class org.apache.commons.jxpath.ri.compiler.Operation

computeContextDependent, getArguments

Methods inherited from class org.apache.commons.jxpath.ri.compiler.Expression

compute, computeContextDependent, computeValue, isContextDependent, iterate, iteratePointers

Constructor Details

CoreOperation

public CoreOperation(args[] )

Method Details

compute

public Object compute(EvalContext context)
Overrides:
compute in interface Expression

computeValue

public abstract Object computeValue(EvalContext context)
Overrides:
computeValue in interface Expression

getPrecedence

protected abstract int getPrecedence()
Computes the precedence of the operation.

getSymbol

public abstract String getSymbol()
Returns the XPath symbol for this operation, e.g. "+", "div", etc.

isSymmetric

protected abstract boolean isSymmetric()
Returns true if the operation is not sensitive to the order of arguments, e.g. "=", "and" etc, and false if it is, e.g. "<=", "div".

toString

public String toString()