svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.api / src / main / java / org / gvsig / fmap / dal / ExpressionBuilder.java @ 43628
History | View | Annotate | Download (9.71 KB)
1 |
package org.gvsig.fmap.dal; |
---|---|
2 |
|
3 |
import java.util.List; |
4 |
import org.cresques.cts.IProjection; |
5 |
import org.gvsig.fmap.geom.Geometry; |
6 |
import org.gvsig.fmap.geom.primitive.Envelope; |
7 |
|
8 |
public interface ExpressionBuilder { |
9 |
|
10 |
public enum GeometrySupportType { |
11 |
WKT, |
12 |
WKB, |
13 |
EWKB, |
14 |
NATIVE |
15 |
} |
16 |
|
17 |
public enum ParameterType { |
18 |
Variable, |
19 |
Constant, |
20 |
Geometry |
21 |
} |
22 |
|
23 |
public interface VisitorFilter { |
24 |
boolean accept(Visitable visitable);
|
25 |
} |
26 |
|
27 |
public interface Visitor { |
28 |
public void visit(Visitable value); |
29 |
} |
30 |
|
31 |
public interface Visitable { |
32 |
public void accept(Visitor visitor, VisitorFilter filter); |
33 |
} |
34 |
|
35 |
public interface Config { |
36 |
public final static String has_spatial_functions = "has_spatial_functions"; |
37 |
public final static String support_schemas = "support_schemas"; |
38 |
public final static String quote_for_identifiers = "quote_for_identifiers"; |
39 |
public final static String quote_for_strings = "quote_for_strings"; |
40 |
public final static String geometry_type_support = "geometry_type_support"; |
41 |
public final static String constant_true = "constant_true"; |
42 |
public final static String constant_false = "constant_false"; |
43 |
public final static String group = "group"; |
44 |
public final static String attribute_crs = "crs"; |
45 |
|
46 |
public final static String Find_SRID = "Find_SRID"; |
47 |
public final static String ST_SRID = "ST_SRID"; |
48 |
public final static String ST_AsText = "ST_AsText"; |
49 |
public final static String ST_AsBinary = "ST_AsBinary"; |
50 |
public final static String ST_AsEWKB = "ST_AsEWKB"; |
51 |
public final static String ST_Contains = "ST_Contains"; |
52 |
public final static String ST_Crosses = "ST_Crosses"; |
53 |
public final static String ST_Disjoint = "ST_Disjoint"; |
54 |
public final static String ST_Equals = "ST_Equals"; |
55 |
public final static String ST_IsClosed = "ST_IsClosed"; |
56 |
public final static String ST_Overlaps = "ST_Overlaps"; |
57 |
public final static String ST_Touches = "ST_Touches"; |
58 |
public final static String ST_Within = "ST_Within"; |
59 |
public final static String ST_Intersects = "ST_Intersects"; |
60 |
public final static String ST_Envelope = "ST_Envelope"; |
61 |
public final static String ST_GeomFromText = "ST_GeomFromText"; |
62 |
public final static String ST_GeomFromWKB = "ST_GeomFromWKB"; |
63 |
public final static String ST_GeomFromEWKB = "ST_GeomFromEWKB"; |
64 |
public final static String ST_Simplify = "ST_Simplify"; |
65 |
public final static String lcase = "lcase"; |
66 |
public final static String ucase = "ucase"; |
67 |
public final static String isNull = "isNull"; |
68 |
public final static String notIsNull = "notIsNull"; |
69 |
public final static String operator_not = "operator_not"; |
70 |
|
71 |
public final static String operator_AND = "operator_AND"; |
72 |
public final static String operator_OR = "operator_OR"; |
73 |
public final static String operator_EQ = "operator_EQ"; |
74 |
public final static String operator_NE = "operator_NE"; |
75 |
public final static String operator_GT = "operator_GT"; |
76 |
public final static String operator_GE = "operator_GE"; |
77 |
public final static String operator_LT = "operator_LT"; |
78 |
public final static String operator_LE = "operator_LE"; |
79 |
public final static String operator_LIKE = "operator_LIKE"; |
80 |
public final static String operator_ILIKE = "operator_ILIKE"; |
81 |
|
82 |
public final static String operator_add = "operator_add"; |
83 |
public final static String operator_subst = "operator_subst"; |
84 |
public final static String operator_mult = "operator_mult"; |
85 |
public final static String operator_div = "operator_div"; |
86 |
public final static String operator_concat = "operator_concat"; |
87 |
|
88 |
|
89 |
public GeometrySupportType getGeometryTypeSupport();
|
90 |
public boolean has_spatial_functions(); |
91 |
public boolean has_functionality(String functionality); |
92 |
public void remove_functionality(String functionality); |
93 |
|
94 |
public boolean getBoolean(String name); |
95 |
public String getString(String name); |
96 |
public Object get(String name); |
97 |
public void set(String name, Object value); |
98 |
} |
99 |
|
100 |
public interface Value extends Visitable { |
101 |
|
102 |
} |
103 |
|
104 |
public interface Group extends Value { |
105 |
public Value getValue();
|
106 |
} |
107 |
|
108 |
public interface Constant extends Value { |
109 |
public Object getValue(); |
110 |
} |
111 |
|
112 |
public interface Custom extends Value { |
113 |
public Object getValue(); |
114 |
public Custom add(Variable variable);
|
115 |
public Custom add(Parameter parameter);
|
116 |
} |
117 |
|
118 |
public interface GeometryValue extends Value { |
119 |
public Geometry getGeometry();
|
120 |
public IProjection getSRS();
|
121 |
} |
122 |
|
123 |
public interface Variable extends Value, Comparable<Variable> { |
124 |
public String getName(); |
125 |
} |
126 |
|
127 |
public interface Parameter extends Value { |
128 |
public Parameter as_constant();
|
129 |
public Parameter as_variable();
|
130 |
public Parameter as_geometry_variable();
|
131 |
public Parameter srs(Value srs);
|
132 |
public Parameter srs(IProjection srs);
|
133 |
public String getName(); |
134 |
public Object getValue(); |
135 |
public Parameter value(Object value); |
136 |
public Parameter name(String value); |
137 |
public ParameterType getType();
|
138 |
public Value getSRS();
|
139 |
public boolean is_constant(); |
140 |
public boolean is_variable(); |
141 |
public boolean is_geometry_variable(); |
142 |
} |
143 |
|
144 |
public interface Parameters extends List<Parameter> { |
145 |
public Parameter get(String name); |
146 |
} |
147 |
|
148 |
public interface Function extends Value { |
149 |
public String getName(); |
150 |
public List<Value> parameters(); |
151 |
public Function parameter(Value parameter);
|
152 |
} |
153 |
|
154 |
public interface BinaryOperator extends Value { |
155 |
public String getName(); |
156 |
public Value getLeft();
|
157 |
public Value getRight();
|
158 |
public BinaryOperator setLeft(Value operand);
|
159 |
public BinaryOperator setRight(Value operand);
|
160 |
} |
161 |
|
162 |
public void accept(Visitor visitor, VisitorFilter filter); |
163 |
|
164 |
public List<Variable> getVariables(); |
165 |
|
166 |
public Parameters getParameters();
|
167 |
|
168 |
public boolean has_spatial_functions(); |
169 |
|
170 |
public GeometrySupportType geometry_support_type();
|
171 |
|
172 |
public String identifier(String name); |
173 |
|
174 |
public String bytearray(byte[] data); |
175 |
|
176 |
public String string(String s); |
177 |
|
178 |
public int getSRSId(IProjection projection); |
179 |
|
180 |
public Config getConfig();
|
181 |
|
182 |
public Value getValue();
|
183 |
|
184 |
public ExpressionBuilder setValue(Value value);
|
185 |
|
186 |
public Variable variable(String name); |
187 |
|
188 |
public Variable column(String name); // Alias for variable(name) |
189 |
|
190 |
public Parameter parameter(String name); |
191 |
|
192 |
public Parameter parameter();
|
193 |
|
194 |
public Constant constant(Object value); |
195 |
|
196 |
public Group group(Value group); |
197 |
|
198 |
public GeometryValue geometry(Geometry geom, IProjection projection);
|
199 |
|
200 |
public GeometryValue envelope(Envelope envelope, IProjection projection);
|
201 |
|
202 |
public Custom custom(Object value); |
203 |
|
204 |
public Constant srs(IProjection projection);
|
205 |
|
206 |
public Function getAsGeometry(Value value);
|
207 |
|
208 |
|
209 |
public Function not(Value value);
|
210 |
|
211 |
public Function notIsNull(Value value);
|
212 |
|
213 |
public Function isNull(Value value);
|
214 |
|
215 |
public Function Find_SRID(Value schema, Value table, Value column);
|
216 |
|
217 |
public Function ST_SRID(Value geom);
|
218 |
|
219 |
public Function ST_AsText(Value geom);
|
220 |
|
221 |
public Function ST_AsBinary(Value geom);
|
222 |
|
223 |
public Function ST_AsEWKB(Value geom);
|
224 |
|
225 |
public Function ST_Envelope(Value geom);
|
226 |
|
227 |
public Function ST_GeomFromText(Value geom, Value crs);
|
228 |
|
229 |
public Function ST_GeomFromWKB(Value geom, Value crs);
|
230 |
|
231 |
public Function ST_GeomFromEWKB(Value geom, Value crs);
|
232 |
|
233 |
public Function ST_Simplify(Value geom, Value tolerance);
|
234 |
|
235 |
public Function ST_Equals(Value geom1, Value geom2);
|
236 |
|
237 |
public Function ST_Intersects(Value geom1, Value geom2);
|
238 |
|
239 |
public Function ST_Contains(Value geom1, Value geom2);
|
240 |
|
241 |
public Function ST_Disjoint(Value geom1, Value geom2);
|
242 |
|
243 |
public Function ST_Crosses(Value geom1, Value geom2);
|
244 |
|
245 |
public Function ST_IsClosed(Value geom1);
|
246 |
|
247 |
public Function ST_Overlaps(Value geom1, Value geom2);
|
248 |
|
249 |
public Function ST_Touches(Value geom1, Value geom2);
|
250 |
|
251 |
public Function ST_Within(Value geom1, Value geom2);
|
252 |
|
253 |
public Function lcase(Value s);
|
254 |
|
255 |
public Function ucase(Value s);
|
256 |
|
257 |
public BinaryOperator and(Value op1, Value op2);
|
258 |
|
259 |
public BinaryOperator or(Value op1, Value op2);
|
260 |
|
261 |
public BinaryOperator eq(Value op1, Value op2);
|
262 |
|
263 |
public BinaryOperator ne(Value op1, Value op2);
|
264 |
|
265 |
public BinaryOperator gt(Value op1, Value op2);
|
266 |
|
267 |
public BinaryOperator ge(Value op1, Value op2);
|
268 |
|
269 |
public BinaryOperator lt(Value op1, Value op2);
|
270 |
|
271 |
public BinaryOperator le(Value op1, Value op2);
|
272 |
|
273 |
public BinaryOperator like(Value op1, Value op2);
|
274 |
|
275 |
public BinaryOperator ilike(Value op1, Value op2);
|
276 |
|
277 |
public BinaryOperator add(Value op1, Value op2);
|
278 |
|
279 |
public BinaryOperator subst(Value op1, Value op2);
|
280 |
|
281 |
public BinaryOperator mult(Value op1, Value op2);
|
282 |
|
283 |
public BinaryOperator div(Value op1, Value op2);
|
284 |
|
285 |
public BinaryOperator concat(Value op1, Value op2);
|
286 |
|
287 |
public ExpressionBuilder set(Value value);
|
288 |
|
289 |
public ExpressionBuilder and(Value value);
|
290 |
|
291 |
public ExpressionBuilder or(Value value);
|
292 |
|
293 |
public ExpressionBuilder createExpressionBuilder();
|
294 |
} |