01: package org.geotools.filter.function;
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.FunctionExpression;
21: import org.geotools.filter.FunctionExpressionImpl;
22:
23: import com.vividsolutions.jts.geom.Geometry;
24:
25: public class FilterFunction_bufferWithSegments extends
26: FunctionExpressionImpl implements FunctionExpression {
27:
28: public FilterFunction_bufferWithSegments() {
29: super ("bufferWithSegments");
30: }
31:
32: public int getArgCount() {
33: return 3;
34: }
35:
36: public Object evaluate(Object feature) {
37: Geometry arg0;
38: double arg1;
39: int arg2;
40:
41: try { // attempt to get value and perform conversion
42: arg0 = (Geometry) getExpression(0).evaluate(feature);
43: } catch (Exception e) // probably a type error
44: {
45: throw new IllegalArgumentException(
46: "Filter Function problem for function bufferWithSegments argument #0 - expected type Geometry");
47: }
48:
49: try { // attempt to get value and perform conversion
50: arg1 = ((Number) getExpression(1).evaluate(feature))
51: .doubleValue();
52: } catch (Exception e) // probably a type error
53: {
54: throw new IllegalArgumentException(
55: "Filter Function problem for function bufferWithSegments argument #1 - expected type double");
56: }
57:
58: try { // attempt to get value and perform conversion
59: arg2 = ((Number) getExpression(2).evaluate(feature))
60: .intValue();
61: } catch (Exception e) // probably a type error
62: {
63: throw new IllegalArgumentException(
64: "Filter Function problem for function bufferWithSegments argument #2 - expected type int");
65: }
66:
67: return (StaticGeometry.bufferWithSegments(arg0, arg1, arg2));
68: }
69: }
|