Statistics
| Revision:

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 / feature / EditableFeature.java @ 45739

History | View | Annotate | Download (8.73 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
import org.gvsig.fmap.dal.exception.DataException;
31

    
32
import org.gvsig.fmap.geom.Geometry;
33
import org.gvsig.timesupport.Instant;
34
import org.gvsig.timesupport.Interval;
35

    
36
/**
37
 * This interface represents a Feature in editable state. To edit a Feature
38
 * you have to obtain its instance of EditableFeature and then perform editing
39
 * operations on it. Once you have completed the editing you can save the changes
40
 * to the original Feature. This is the only way to edit a Feature.
41
 */
42
public interface EditableFeature extends Feature {
43
        public boolean isUpdatable();
44

    
45
        public void setUpdatable(boolean updatable);
46

    
47
        /**
48
         * Sets the value of an attribute given its name
49
         * @param name
50
         *                         attribute's name
51
         * @param value
52
         *                  value to set
53
         */
54
        public void set(String name, Object value);
55

    
56
        /**
57
         * Sets the value of an attribute given its index
58
         * @param index
59
         *                         attribute's index
60
         * @param value
61
         *                  value to set
62
         */
63
        public void set(int index, Object value);
64

    
65
        /**
66
         * Sets the value of an attribute of type integer, given its name
67
         * @param name
68
         *                         attribute's name
69
         * @param value
70
         *                  value to set
71
         */
72
        public void setInt(String name, int value);
73

    
74
        /**
75
         * Sets the value of an attribute of type integer, given its index
76
         * @param index
77
         *                         attribute's index
78
         * @param value
79
         *                  value to set
80
         */
81
        public void setInt(int index, int value);
82

    
83
        /**
84
         * Sets the value of an attribute of type boolean, given its name
85
         * @param name
86
         *                         attribute's name
87
         * @param value
88
         *                  value to set
89
         */
90
        public void setBoolean(String name, boolean value);
91

    
92
        /**
93
         * Sets the value of an attribute of type boolean, given its index
94
         * @param index
95
         *                         attribute's index
96
         * @param value
97
         *                  value to set
98
         */
99
        public void setBoolean(int index, boolean value);
100

    
101
        /**
102
         * Sets the value of an attribute of type long, given its name
103
         * @param name
104
         *                         attribute's name
105
         * @param value
106
         *                  value to set
107
         */
108
        public void setLong(String name, long value);
109

    
110
        /**
111
         * Sets the value of an attribute of type long, given its index
112
         * @param index
113
         *                         attribute's index
114
         * @param value
115
         *                  value to set
116
         */
117
        public void setLong(int index, long value);
118

    
119
        /**
120
         * Sets the value of an attribute of type float, given its name
121
         * @param name
122
         *                         attribute's name
123
         * @param value
124
         *                  value to set
125
         */
126
        public void setFloat(String name, float value);
127

    
128
        /**
129
         * Sets the value of an attribute of type float, given its index
130
         * @param index
131
         *                         attribute's index
132
         * @param value
133
         *                  value to set
134
         */
135
        public void setFloat(int index, float value);
136

    
137
        /**
138
         * Sets the value of an attribute of type double, given its name
139
         * @param name
140
         *                         attribute's name
141
         * @param value
142
         *                  value to set
143
         */
144
        public void setDouble(String name, double value);
145

    
146
        /**
147
         * Sets the value of an attribute of type double, given its index
148
         * @param index
149
         *                         attribute's index
150
         * @param value
151
         *                  value to set
152
         */
153
        public void setDouble(int index, double value);
154

    
155
        /**
156
         * Sets the value of an attribute of type BigDecimal, given its name
157
         * @param name
158
         *                         attribute's name
159
         * @param value
160
         *                  value to set
161
         */
162
        public void setDecimal(String name, BigDecimal value);
163

    
164
        /**
165
         * Sets the value of an attribute of type BigDecimal, given its index
166
         * @param index
167
         *                         attribute's index
168
         * @param value
169
         *                  value to set
170
         */
171
        public void setDecimal(int index, BigDecimal value);
172

    
173
        /**
174
         * Sets the value of an attribute of type date, given its name
175
         * @param name
176
         *                         attribute's name
177
         * @param value
178
         *                  value to set
179
         */
180
        public void setDate(String name, Date value);
181

    
182
        /**
183
         * Sets the value of an attribute of type date, given its index
184
         * @param index
185
         *                         attribute's index
186
         * @param value
187
         *                  value to set
188
         */
189
        public void setDate(int index, Date value);
190

    
191
        /**
192
         * Sets the value of an attribute of type string, given its name
193
         * @param name
194
         *                         attribute's name
195
         * @param value
196
         *                  value to set
197
         */
198
        public void setString(String name, String value);
199

    
200
        /**
201
         * Sets the value of an attribute of type string, given its index
202
         * @param index
203
         *                         attribute's index
204
         * @param value
205
         *                  value to set
206
         */
207
        public void setString(int index, String value);
208

    
209
        /**
210
         * Sets the value of an attribute of type byte, given its name
211
         * @param name
212
         *                         attribute's name
213
         * @param value
214
         *                  value to set
215
         */
216
        public void setByte(String name, byte value);
217

    
218
        /**
219
         * Sets the value of an attribute of type byte, given its index
220
         * @param index
221
         *                         attribute's index
222
         * @param value
223
         *                  value to set
224
         */
225
        public void setByte(int index, byte value);
226

    
227
        /**
228
         * Sets the value of an attribute of type geometry, given its name
229
         * @param name
230
         *                         attribute's name
231
         * @param value
232
         *                  value to set
233
         */
234
        public void setGeometry(String name, Geometry value);
235

    
236
        /**
237
         * Sets the value of an attribute of type geometry, given its index
238
         * @param index
239
         *                         attribute's index
240
         * @param value
241
         *                  value to set
242
         */
243
        public void setGeometry(int index, Geometry value);
244

    
245
        /**
246
         * Sets the value of an attribute of type array, given its name
247
         * @param name
248
         *                         attribute's name
249
         * @param value
250
         *                  value to set
251
         */
252
        public void setArray(String name, Object[] value);
253

    
254
        /**
255
         * Sets the value of an attribute of type array, given its index
256
         * @param index
257
         *                         attribute's index
258
         * @param value
259
         *                  value to set
260
         */
261
        public void setArray(int index, Object[] value);
262

    
263
        /**
264
         * Sets the value of an attribute of type feature, given its name
265
         * @param name
266
         *                         attribute's name
267
         * @param value
268
         *                  value to set
269
         */
270
        public void setFeature(String name, Feature value);
271

    
272
        /**
273
         * Sets the value of an attribute of type feature, given its index
274
         * @param index
275
         *                         attribute's index
276
         * @param value
277
         *                  value to set
278
         */
279
        public void setFeature(int index, Feature value);
280

    
281
        /**
282
         * Returns the Feature from which this EditableFeature was created
283
         *
284
         * @return Feature from which this EditableFeature was created
285
         */
286
        public Feature getSource();
287

    
288
        /**
289
         * Returns a non editable copy of the Feature.
290
         *
291
         * @return non editable copy of the Feature.
292
         */
293
        public Feature getNotEditableCopy();
294

    
295
        /**
296
         * Sets de value of the default geometry attribute.
297
         *
298
         * @param value geometry to set.
299
         */
300
        public void setDefaultGeometry(Geometry value);
301
        
302
        /**
303
         * Copies the values of all attributes from the source feature to this feature
304
         * 
305
         * @param source
306
         *                         source feature from which the values will be copied.
307
         */
308
        public void copyFrom(Feature source);        
309
        
310
        public void copyFrom(Feature values, Predicate<FeatureAttributeDescriptor> filter);
311
        
312
        public void copyFrom(JsonObject source);        
313
        
314
        public void copyFrom(JsonObject values, Predicate<FeatureAttributeDescriptor> filter);
315
        
316
        /**
317
     * Sets the value of an attribute of type instant, given its name
318
     * @param name
319
     *          attribute's name
320
     * @param value
321
     *          value to set
322
     */
323
        public void setInstant(String name, Instant value);
324

    
325
        /**
326
     * Sets the value of an attribute of type instant, given its index
327
     * @param index
328
     *          attribute's index
329
     * @param value
330
     *          value to set
331
     */
332
        public void setInstant(int index, Instant value);  
333

    
334
        /**
335
     * Sets the value of an attribute of type interval, given its name
336
     * @param name
337
     *          attribute's name
338
     * @param value
339
     *          value to set
340
     */
341
        public void setInterval(String name, Interval value);
342

    
343
        /**
344
     * Sets the value of an attribute of type interval, given its index
345
     * @param index
346
     *          attribute's index
347
     * @param value
348
     *          value to set
349
     */
350
        public void setInterval(int index, Interval value); 
351
}