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

java.lang.Object
  extended byorg.apache.commons.jxpath.ri.compiler.Expression
      extended byorg.apache.commons.jxpath.ri.compiler.Operation
          extended byorg.apache.commons.jxpath.ri.compiler.CoreOperation
              extended byorg.apache.commons.jxpath.ri.compiler.CoreOperationNegate

public class CoreOperationNegate
extends CoreOperation

Implementation of Expression for the operation unary "-".

Version:
$Revision: 1.3 $ $Date: 2004/02/29 14:17:39 $
Author:
Dmitri Plotnikov

Nested Class Summary
 
Nested classes 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
CoreOperationNegate(Expression arg)
           
 
Method Summary
 java.lang.Object computeValue(EvalContext context)
          Evaluates the expression.
protected  int getPrecedence()
          Computes the precedence of the operation.
 java.lang.String getSymbol()
          Returns the XPath symbol for this operation, e.g.
protected  boolean isSymmetric()
          Returns true if the operation is not sensitive to the order of arguments, e.g.
 
Methods inherited from class org.apache.commons.jxpath.ri.compiler.CoreOperation
compute, 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

CoreOperationNegate

public CoreOperationNegate(Expression arg)
Method Detail

computeValue

public 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.

Specified by:
computeValue in class CoreOperation

getPrecedence

protected int getPrecedence()
Description copied from class: CoreOperation
Computes the precedence of the operation.

Specified by:
getPrecedence in class CoreOperation

isSymmetric

protected boolean isSymmetric()
Description copied from class: CoreOperation
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".

Specified by:
isSymmetric in class CoreOperation

getSymbol

public java.lang.String getSymbol()
Description copied from class: CoreOperation
Returns the XPath symbol for this operation, e.g. "+", "div", etc.

Specified by:
getSymbol in class CoreOperation