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 @ 44669

History | View | Annotate | Download (8.35 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 javax.json.JsonObject;
29

    
30
import org.gvsig.fmap.geom.Geometry;
31
import org.gvsig.timesupport.Instant;
32
import org.gvsig.timesupport.Interval;
33

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

    
42
        /**
43
         * Sets the value of an attribute given its name
44
         * @param name
45
         *                         attribute's name
46
         * @param value
47
         *                  value to set
48
         */
49
        public void set(String name, Object value);
50

    
51
        /**
52
         * Sets the value of an attribute given its index
53
         * @param index
54
         *                         attribute's index
55
         * @param value
56
         *                  value to set
57
         */
58
        public void set(int index, Object value);
59

    
60
        /**
61
         * Sets the value of an attribute of type integer, given its name
62
         * @param name
63
         *                         attribute's name
64
         * @param value
65
         *                  value to set
66
         */
67
        public void setInt(String name, int value);
68

    
69
        /**
70
         * Sets the value of an attribute of type integer, given its index
71
         * @param index
72
         *                         attribute's index
73
         * @param value
74
         *                  value to set
75
         */
76
        public void setInt(int index, int value);
77

    
78
        /**
79
         * Sets the value of an attribute of type boolean, given its name
80
         * @param name
81
         *                         attribute's name
82
         * @param value
83
         *                  value to set
84
         */
85
        public void setBoolean(String name, boolean value);
86

    
87
        /**
88
         * Sets the value of an attribute of type boolean, given its index
89
         * @param index
90
         *                         attribute's index
91
         * @param value
92
         *                  value to set
93
         */
94
        public void setBoolean(int index, boolean value);
95

    
96
        /**
97
         * Sets the value of an attribute of type long, given its name
98
         * @param name
99
         *                         attribute's name
100
         * @param value
101
         *                  value to set
102
         */
103
        public void setLong(String name, long value);
104

    
105
        /**
106
         * Sets the value of an attribute of type long, given its index
107
         * @param index
108
         *                         attribute's index
109
         * @param value
110
         *                  value to set
111
         */
112
        public void setLong(int index, long value);
113

    
114
        /**
115
         * Sets the value of an attribute of type float, given its name
116
         * @param name
117
         *                         attribute's name
118
         * @param value
119
         *                  value to set
120
         */
121
        public void setFloat(String name, float value);
122

    
123
        /**
124
         * Sets the value of an attribute of type float, given its index
125
         * @param index
126
         *                         attribute's index
127
         * @param value
128
         *                  value to set
129
         */
130
        public void setFloat(int index, float value);
131

    
132
        /**
133
         * Sets the value of an attribute of type double, given its name
134
         * @param name
135
         *                         attribute's name
136
         * @param value
137
         *                  value to set
138
         */
139
        public void setDouble(String name, double value);
140

    
141
        /**
142
         * Sets the value of an attribute of type double, given its index
143
         * @param index
144
         *                         attribute's index
145
         * @param value
146
         *                  value to set
147
         */
148
        public void setDouble(int index, double value);
149

    
150
        /**
151
         * Sets the value of an attribute of type BigDecimal, given its name
152
         * @param name
153
         *                         attribute's name
154
         * @param value
155
         *                  value to set
156
         */
157
        public void setDecimal(String name, BigDecimal value);
158

    
159
        /**
160
         * Sets the value of an attribute of type BigDecimal, given its index
161
         * @param index
162
         *                         attribute's index
163
         * @param value
164
         *                  value to set
165
         */
166
        public void setDecimal(int index, BigDecimal value);
167

    
168
        /**
169
         * Sets the value of an attribute of type date, given its name
170
         * @param name
171
         *                         attribute's name
172
         * @param value
173
         *                  value to set
174
         */
175
        public void setDate(String name, Date value);
176

    
177
        /**
178
         * Sets the value of an attribute of type date, given its index
179
         * @param index
180
         *                         attribute's index
181
         * @param value
182
         *                  value to set
183
         */
184
        public void setDate(int index, Date value);
185

    
186
        /**
187
         * Sets the value of an attribute of type string, given its name
188
         * @param name
189
         *                         attribute's name
190
         * @param value
191
         *                  value to set
192
         */
193
        public void setString(String name, String value);
194

    
195
        /**
196
         * Sets the value of an attribute of type string, given its index
197
         * @param index
198
         *                         attribute's index
199
         * @param value
200
         *                  value to set
201
         */
202
        public void setString(int index, String value);
203

    
204
        /**
205
         * Sets the value of an attribute of type byte, given its name
206
         * @param name
207
         *                         attribute's name
208
         * @param value
209
         *                  value to set
210
         */
211
        public void setByte(String name, byte value);
212

    
213
        /**
214
         * Sets the value of an attribute of type byte, given its index
215
         * @param index
216
         *                         attribute's index
217
         * @param value
218
         *                  value to set
219
         */
220
        public void setByte(int index, byte value);
221

    
222
        /**
223
         * Sets the value of an attribute of type geometry, given its name
224
         * @param name
225
         *                         attribute's name
226
         * @param value
227
         *                  value to set
228
         */
229
        public void setGeometry(String name, Geometry value);
230

    
231
        /**
232
         * Sets the value of an attribute of type geometry, given its index
233
         * @param index
234
         *                         attribute's index
235
         * @param value
236
         *                  value to set
237
         */
238
        public void setGeometry(int index, Geometry value);
239

    
240
        /**
241
         * Sets the value of an attribute of type array, given its name
242
         * @param name
243
         *                         attribute's name
244
         * @param value
245
         *                  value to set
246
         */
247
        public void setArray(String name, Object[] value);
248

    
249
        /**
250
         * Sets the value of an attribute of type array, given its index
251
         * @param index
252
         *                         attribute's index
253
         * @param value
254
         *                  value to set
255
         */
256
        public void setArray(int index, Object[] value);
257

    
258
        /**
259
         * Sets the value of an attribute of type feature, given its name
260
         * @param name
261
         *                         attribute's name
262
         * @param value
263
         *                  value to set
264
         */
265
        public void setFeature(String name, Feature value);
266

    
267
        /**
268
         * Sets the value of an attribute of type feature, given its index
269
         * @param index
270
         *                         attribute's index
271
         * @param value
272
         *                  value to set
273
         */
274
        public void setFeature(int index, Feature value);
275

    
276
        /**
277
         * Returns the Feature from which this EditableFeature was created
278
         *
279
         * @return Feature from which this EditableFeature was created
280
         */
281
        public Feature getSource();
282

    
283
        /**
284
         * Returns a non editable copy of the Feature.
285
         *
286
         * @return non editable copy of the Feature.
287
         */
288
        public Feature getNotEditableCopy();
289

    
290
        /**
291
         * Sets de value of the default geometry attribute.
292
         *
293
         * @param value geometry to set.
294
         */
295
        public void setDefaultGeometry(Geometry value);
296
        
297
        /**
298
         * Copies the values of all attributes from the source feature to this feature
299
         * 
300
         * @param source
301
         *                         source feature from which the values will be copied.
302
         */
303
        public void copyFrom(Feature source);        
304
        
305
        public void copyFrom(JsonObject source);        
306
        
307
        /**
308
     * Sets the value of an attribute of type instant, given its name
309
     * @param name
310
     *          attribute's name
311
     * @param value
312
     *          value to set
313
     */
314
        public void setInstant(String name, Instant value);
315

    
316
        /**
317
     * Sets the value of an attribute of type instant, given its index
318
     * @param index
319
     *          attribute's index
320
     * @param value
321
     *          value to set
322
     */
323
        public void setInstant(int index, Instant value);  
324

    
325
        /**
326
     * Sets the value of an attribute of type interval, given its name
327
     * @param name
328
     *          attribute's name
329
     * @param value
330
     *          value to set
331
     */
332
        public void setInterval(String name, Interval value);
333

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