01: package org.geotools.filter.function.math;
02:
03: /*
04: * GeoTools - OpenSource mapping toolkit
05: * http://geotools.org
06: * (C) 2005-2006, GeoTools Project Managment Committee (PMC)
07: *
08: * This library is free software; you can redistribute it and/or
09: * modify it under the terms of the GNU Lesser General Public
10: * License as published by the Free Software Foundation;
11: * version 2.1 of the License.
12: *
13: * This library is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16: * Lesser General Public License for more details.
17: */
18:
19: //this code is autogenerated - you shouldnt be modifying it!
20: import org.geotools.filter.FunctionExpressionImpl;
21:
22: public class FilterFunction_ceil extends FunctionExpressionImpl {
23:
24: public FilterFunction_ceil() {
25: super ("ceil");
26: }
27:
28: public int getArgCount() {
29: return 1;
30: }
31:
32: public Object evaluate(Object feature) {
33: double arg0;
34:
35: try { // attempt to get value and perform conversion
36: arg0 = ((Number) getExpression(0).evaluate(feature))
37: .doubleValue();
38: } catch (Exception e) {
39: // probably a type error
40: throw new IllegalArgumentException(
41: "Filter Function problem for function ceil argument #0 - expected type double");
42: }
43:
44: return new Double(Math.ceil(arg0));
45: }
46: }
|