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 CoreOperationMod extends CoreOperation { 28 29 public CoreOperationMod(Expression arg1, Expression arg2) { 30 super(new Expression[] { arg1, arg2 }); 31 } 32 33 public Object computeValue(EvalContext context) { 34 long l = (long) InfoSetUtil.doubleValue(args[0].computeValue(context)); 35 long r = (long) InfoSetUtil.doubleValue(args[1].computeValue(context)); 36 return new Double (l % r); 37 } 38 39 protected int getPrecedence() { 40 return 5; 41 } 42 43 protected boolean isSymmetric() { 44 return false; 45 } 46 47 public String getSymbol() { 48 return "mod"; 49 } 50 } 51 | Popular Tags |