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: public class FilterFunction_isLike extends FunctionExpressionImpl
24: implements FunctionExpression {
25:
26: public FilterFunction_isLike() {
27: super ("isLike");
28: }
29:
30: public int getArgCount() {
31: return 2;
32: }
33:
34: public Object evaluate(Object feature) {
35: String arg0;
36: String arg1;
37:
38: try { // attempt to get value and perform conversion
39: arg0 = (String) getExpression(0).evaluate(feature,
40: String.class); // extra
41: // protection
42: // for
43: // strings
44: } catch (Exception e) // probably a type error
45: {
46: throw new IllegalArgumentException(
47: "Filter Function problem for function isLike argument #0 - expected type String");
48: }
49:
50: try { // attempt to get value and perform conversion
51: arg1 = (String) getExpression(1).evaluate(feature,
52: String.class); // extra
53: // protection
54: // for
55: // strings
56: } catch (Exception e) // probably a type error
57: {
58: throw new IllegalArgumentException(
59: "Filter Function problem for function isLike argument #1 - expected type String");
60: }
61:
62: return new Boolean(StaticGeometry.isLike(arg0, arg1));
63: }
64: }
|