svn-gvsig-desktop / branches / org.gvsig.desktop-cvsgis1 / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.api / src / main / java / org / gvsig / fmap / dal / feature / EditableFeature.java @ 45276
History | View | Annotate | Download (8.68 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 3
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.fmap.dal.feature; |
25 |
|
26 |
import java.math.BigDecimal; |
27 |
import java.util.Date; |
28 |
import java.util.function.Predicate; |
29 |
import javax.json.JsonObject; |
30 |
|
31 |
import org.gvsig.fmap.geom.Geometry; |
32 |
import org.gvsig.timesupport.Instant; |
33 |
import org.gvsig.timesupport.Interval; |
34 |
|
35 |
/**
|
36 |
* This interface represents a Feature in editable state. To edit a Feature
|
37 |
* you have to obtain its instance of EditableFeature and then perform editing
|
38 |
* operations on it. Once you have completed the editing you can save the changes
|
39 |
* to the original Feature. This is the only way to edit a Feature.
|
40 |
*/
|
41 |
public interface EditableFeature extends Feature { |
42 |
public boolean isUpdatable(); |
43 |
|
44 |
public void setUpdatable(boolean updatable); |
45 |
|
46 |
/**
|
47 |
* Sets the value of an attribute given its name
|
48 |
* @param name
|
49 |
* attribute's name
|
50 |
* @param value
|
51 |
* value to set
|
52 |
*/
|
53 |
public void set(String name, Object value); |
54 |
|
55 |
/**
|
56 |
* Sets the value of an attribute given its index
|
57 |
* @param index
|
58 |
* attribute's index
|
59 |
* @param value
|
60 |
* value to set
|
61 |
*/
|
62 |
public void set(int index, Object value); |
63 |
|
64 |
/**
|
65 |
* Sets the value of an attribute of type integer, given its name
|
66 |
* @param name
|
67 |
* attribute's name
|
68 |
* @param value
|
69 |
* value to set
|
70 |
*/
|
71 |
public void setInt(String name, int value); |
72 |
|
73 |
/**
|
74 |
* Sets the value of an attribute of type integer, given its index
|
75 |
* @param index
|
76 |
* attribute's index
|
77 |
* @param value
|
78 |
* value to set
|
79 |
*/
|
80 |
public void setInt(int index, int value); |
81 |
|
82 |
/**
|
83 |
* Sets the value of an attribute of type boolean, given its name
|
84 |
* @param name
|
85 |
* attribute's name
|
86 |
* @param value
|
87 |
* value to set
|
88 |
*/
|
89 |
public void setBoolean(String name, boolean value); |
90 |
|
91 |
/**
|
92 |
* Sets the value of an attribute of type boolean, given its index
|
93 |
* @param index
|
94 |
* attribute's index
|
95 |
* @param value
|
96 |
* value to set
|
97 |
*/
|
98 |
public void setBoolean(int index, boolean value); |
99 |
|
100 |
/**
|
101 |
* Sets the value of an attribute of type long, given its name
|
102 |
* @param name
|
103 |
* attribute's name
|
104 |
* @param value
|
105 |
* value to set
|
106 |
*/
|
107 |
public void setLong(String name, long value); |
108 |
|
109 |
/**
|
110 |
* Sets the value of an attribute of type long, given its index
|
111 |
* @param index
|
112 |
* attribute's index
|
113 |
* @param value
|
114 |
* value to set
|
115 |
*/
|
116 |
public void setLong(int index, long value); |
117 |
|
118 |
/**
|
119 |
* Sets the value of an attribute of type float, given its name
|
120 |
* @param name
|
121 |
* attribute's name
|
122 |
* @param value
|
123 |
* value to set
|
124 |
*/
|
125 |
public void setFloat(String name, float value); |
126 |
|
127 |
/**
|
128 |
* Sets the value of an attribute of type float, given its index
|
129 |
* @param index
|
130 |
* attribute's index
|
131 |
* @param value
|
132 |
* value to set
|
133 |
*/
|
134 |
public void setFloat(int index, float value); |
135 |
|
136 |
/**
|
137 |
* Sets the value of an attribute of type double, given its name
|
138 |
* @param name
|
139 |
* attribute's name
|
140 |
* @param value
|
141 |
* value to set
|
142 |
*/
|
143 |
public void setDouble(String name, double value); |
144 |
|
145 |
/**
|
146 |
* Sets the value of an attribute of type double, given its index
|
147 |
* @param index
|
148 |
* attribute's index
|
149 |
* @param value
|
150 |
* value to set
|
151 |
*/
|
152 |
public void setDouble(int index, double value); |
153 |
|
154 |
/**
|
155 |
* Sets the value of an attribute of type BigDecimal, given its name
|
156 |
* @param name
|
157 |
* attribute's name
|
158 |
* @param value
|
159 |
* value to set
|
160 |
*/
|
161 |
public void setDecimal(String name, BigDecimal value); |
162 |
|
163 |
/**
|
164 |
* Sets the value of an attribute of type BigDecimal, given its index
|
165 |
* @param index
|
166 |
* attribute's index
|
167 |
* @param value
|
168 |
* value to set
|
169 |
*/
|
170 |
public void setDecimal(int index, BigDecimal value); |
171 |
|
172 |
/**
|
173 |
* Sets the value of an attribute of type date, given its name
|
174 |
* @param name
|
175 |
* attribute's name
|
176 |
* @param value
|
177 |
* value to set
|
178 |
*/
|
179 |
public void setDate(String name, Date value); |
180 |
|
181 |
/**
|
182 |
* Sets the value of an attribute of type date, given its index
|
183 |
* @param index
|
184 |
* attribute's index
|
185 |
* @param value
|
186 |
* value to set
|
187 |
*/
|
188 |
public void setDate(int index, Date value); |
189 |
|
190 |
/**
|
191 |
* Sets the value of an attribute of type string, given its name
|
192 |
* @param name
|
193 |
* attribute's name
|
194 |
* @param value
|
195 |
* value to set
|
196 |
*/
|
197 |
public void setString(String name, String value); |
198 |
|
199 |
/**
|
200 |
* Sets the value of an attribute of type string, given its index
|
201 |
* @param index
|
202 |
* attribute's index
|
203 |
* @param value
|
204 |
* value to set
|
205 |
*/
|
206 |
public void setString(int index, String value); |
207 |
|
208 |
/**
|
209 |
* Sets the value of an attribute of type byte, given its name
|
210 |
* @param name
|
211 |
* attribute's name
|
212 |
* @param value
|
213 |
* value to set
|
214 |
*/
|
215 |
public void setByte(String name, byte value); |
216 |
|
217 |
/**
|
218 |
* Sets the value of an attribute of type byte, given its index
|
219 |
* @param index
|
220 |
* attribute's index
|
221 |
* @param value
|
222 |
* value to set
|
223 |
*/
|
224 |
public void setByte(int index, byte value); |
225 |
|
226 |
/**
|
227 |
* Sets the value of an attribute of type geometry, given its name
|
228 |
* @param name
|
229 |
* attribute's name
|
230 |
* @param value
|
231 |
* value to set
|
232 |
*/
|
233 |
public void setGeometry(String name, Geometry value); |
234 |
|
235 |
/**
|
236 |
* Sets the value of an attribute of type geometry, given its index
|
237 |
* @param index
|
238 |
* attribute's index
|
239 |
* @param value
|
240 |
* value to set
|
241 |
*/
|
242 |
public void setGeometry(int index, Geometry value); |
243 |
|
244 |
/**
|
245 |
* Sets the value of an attribute of type array, given its name
|
246 |
* @param name
|
247 |
* attribute's name
|
248 |
* @param value
|
249 |
* value to set
|
250 |
*/
|
251 |
public void setArray(String name, Object[] value); |
252 |
|
253 |
/**
|
254 |
* Sets the value of an attribute of type array, given its index
|
255 |
* @param index
|
256 |
* attribute's index
|
257 |
* @param value
|
258 |
* value to set
|
259 |
*/
|
260 |
public void setArray(int index, Object[] value); |
261 |
|
262 |
/**
|
263 |
* Sets the value of an attribute of type feature, given its name
|
264 |
* @param name
|
265 |
* attribute's name
|
266 |
* @param value
|
267 |
* value to set
|
268 |
*/
|
269 |
public void setFeature(String name, Feature value); |
270 |
|
271 |
/**
|
272 |
* Sets the value of an attribute of type feature, given its index
|
273 |
* @param index
|
274 |
* attribute's index
|
275 |
* @param value
|
276 |
* value to set
|
277 |
*/
|
278 |
public void setFeature(int index, Feature value); |
279 |
|
280 |
/**
|
281 |
* Returns the Feature from which this EditableFeature was created
|
282 |
*
|
283 |
* @return Feature from which this EditableFeature was created
|
284 |
*/
|
285 |
public Feature getSource();
|
286 |
|
287 |
/**
|
288 |
* Returns a non editable copy of the Feature.
|
289 |
*
|
290 |
* @return non editable copy of the Feature.
|
291 |
*/
|
292 |
public Feature getNotEditableCopy();
|
293 |
|
294 |
/**
|
295 |
* Sets de value of the default geometry attribute.
|
296 |
*
|
297 |
* @param value geometry to set.
|
298 |
*/
|
299 |
public void setDefaultGeometry(Geometry value); |
300 |
|
301 |
/**
|
302 |
* Copies the values of all attributes from the source feature to this feature
|
303 |
*
|
304 |
* @param source
|
305 |
* source feature from which the values will be copied.
|
306 |
*/
|
307 |
public void copyFrom(Feature source); |
308 |
|
309 |
public void copyFrom(Feature values, Predicate<FeatureAttributeDescriptor> filter); |
310 |
|
311 |
public void copyFrom(JsonObject source); |
312 |
|
313 |
public void copyFrom(JsonObject values, Predicate<FeatureAttributeDescriptor> filter); |
314 |
|
315 |
/**
|
316 |
* Sets the value of an attribute of type instant, given its name
|
317 |
* @param name
|
318 |
* attribute's name
|
319 |
* @param value
|
320 |
* value to set
|
321 |
*/
|
322 |
public void setInstant(String name, Instant value); |
323 |
|
324 |
/**
|
325 |
* Sets the value of an attribute of type instant, given its index
|
326 |
* @param index
|
327 |
* attribute's index
|
328 |
* @param value
|
329 |
* value to set
|
330 |
*/
|
331 |
public void setInstant(int index, Instant value); |
332 |
|
333 |
/**
|
334 |
* Sets the value of an attribute of type interval, given its name
|
335 |
* @param name
|
336 |
* attribute's name
|
337 |
* @param value
|
338 |
* value to set
|
339 |
*/
|
340 |
public void setInterval(String name, Interval value); |
341 |
|
342 |
/**
|
343 |
* Sets the value of an attribute of type interval, given its index
|
344 |
* @param index
|
345 |
* attribute's index
|
346 |
* @param value
|
347 |
* value to set
|
348 |
*/
|
349 |
public void setInterval(int index, Interval value); |
350 |
} |