1 16 package org.apache.commons.jxpath.ri.compiler; 17 18 import org.apache.commons.jxpath.ri.EvalContext; 19 import org.apache.commons.jxpath.ri.InfoSetUtil; 20 21 27 public class CoreOperationNegate extends CoreOperation { 28 29 public CoreOperationNegate(Expression arg) { 30 super(new Expression[] { arg }); 31 } 32 33 public Object computeValue(EvalContext context) { 34 double a = InfoSetUtil.doubleValue(args[0].computeValue(context)); 35 return new Double (-a); 36 } 37 38 protected int getPrecedence() { 39 return 6; 40 } 41 42 protected boolean isSymmetric() { 43 return false; 44 } 45 46 public String getSymbol() { 47 return "-"; 48 } 49 } 50 | Popular Tags |