1
2
3
4
5
6
7
8
9 package net.kwfgrid.gwes.jaxen;
10
11 import org.jaxen.Function;
12 import org.jaxen.Context;
13 import org.jaxen.FunctionCallException;
14 import org.jaxen.function.NumberFunction;
15
16 import java.util.List;
17 import java.util.Calendar;
18
19
20
21
22
23
24
25
26 public class Ms2minuteFunction implements Function {
27
28 public Object call(Context context, List args) throws FunctionCallException {
29 if (args.isEmpty()) throw new FunctionCallException("Argument missing.");
30 if (args.size() > 1) throw new FunctionCallException("Too many arguments.");
31 Double dms = (Double)args.get(0);
32 long ms = dms.longValue();
33 TimeScheme time = new TimeScheme(ms);
34 Integer ivalue = time.getCal().get(Calendar.MINUTE);
35 return ivalue.doubleValue();
36 }
37
38 }