org.apache.commons.jxpath.ri.compiler
Class CoreOperation

java.lang.Object
  |
  +--org.apache.commons.jxpath.ri.compiler.Expression
        |
        +--org.apache.commons.jxpath.ri.compiler.Operation
              |
              +--org.apache.commons.jxpath.ri.compiler.CoreOperation
Direct Known 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.12 $ $Date: 2003/03/11 00:59:22 $
Author:
Dmitri Plotnikov

Inner classes inherited from class org.apache.commons.jxpath.ri.compiler.Expression
Expression.PointerIterator, Expression.ValueIterator
 
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(Expression[] args)
           
 
Method Summary
 java.lang.Object compute(EvalContext context)
           
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.
 java.lang.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
isContextDependent, iterate, iteratePointers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CoreOperation

public CoreOperation(Expression[] args)
Method Detail

compute

public java.lang.Object compute(EvalContext context)
Overrides:
compute in class Expression

computeValue

public abstract java.lang.Object computeValue(EvalContext context)
Description copied from class: Expression
Evaluates the expression. If the result is a node set, returns the first element of the node set.
Overrides:
computeValue in class Expression

getSymbol

public abstract java.lang.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".

getPrecedence

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2001-2003 Apache Software Foundation. All Rights Reserved.