1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springmodules.validation.valang.functions;
18
19 public class DivideFunction extends AbstractMathFunction {
20
21 public DivideFunction(Function leftFunction, Function rightFunction, int line, int column) {
22 super(leftFunction, rightFunction, line, column);
23 }
24
25 public Object getResult(Object target) {
26 return getTemplate().execute(target, new FunctionCallback() {
27 public Object execute(Object target) throws Exception {
28 return new Double(transform(getLeftFunction().getResult(target)) / transform(getRightFunction().getResult(target)));
29 }
30 });
31 }
32
33 }