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