1 51 package org.apache.fop.fo.expr; 52 53 import org.apache.fop.fo.Property; 54 import org.apache.fop.fo.NumberProperty; 55 56 class CeilingFunction extends FunctionBase { 57 58 public int nbArgs() { 59 return 1; 60 } 61 62 public Property eval(Property[] args, 63 PropertyInfo pInfo) throws PropertyException { 64 Number dbl = args[0].getNumber(); 65 if (dbl == null) 66 throw new PropertyException("Non number operand to ceiling function"); 67 return new NumberProperty(Math.ceil(dbl.doubleValue())); 68 } 69 70 } 71 | Popular Tags |