1 51 package org.apache.fop.fo.expr; 52 53 import org.apache.fop.fo.Property; 54 55 public class AbsFunction extends FunctionBase { 56 57 public int nbArgs() { 58 return 1; 59 } 60 61 public Property eval(Property[] args, 62 PropertyInfo propInfo) throws PropertyException { 63 Numeric num = args[0].getNumeric(); 64 if (num == null) 65 throw new PropertyException("Non numeric operand to abs function"); 66 return new NumericProperty(num.abs()); 68 } 69 70 } 71 72 | Popular Tags |