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