20 import ca.uqac.lif.cep.functions.BinaryFunction;
21 import ca.uqac.lif.cep.functions.FunctionException;
33 public class Maximum extends BinaryFunction<Number,Number,Number>
50 super(Number.class, Number.class, Number.class);
54 public Number getValue(Number x, Number y)
60 if (x.floatValue() > y.floatValue())
70 public static void main(String[] args)
throws FunctionException
73 Object[] value =
new Object[1];
77 max.evaluate(
new Float[]{3.5f, 10f}, value);
81 System.out.printf(
"Return value of the function: %f\n", value[0]);
82 max.evaluate(
new Float[]{13.1f, 7.7f}, value);
83 System.out.printf(
"Return value of the function: %f\n", value[0]);
Binary function that returns the maximum of two values.