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 / EditableFeatureAttributeDescriptor.java @ 45154

History | View | Annotate | Download (9.08 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.text.DateFormat;
27
import java.util.Locale;
28
import org.cresques.cts.IProjection;
29
import org.gvsig.expressionevaluator.Expression;
30

    
31
import org.gvsig.fmap.dal.DataTypes;
32
import org.gvsig.fmap.dal.feature.exception.AttributeFeatureTypeIntegrityException;
33
import org.gvsig.fmap.geom.type.GeometryType;
34
import org.gvsig.timesupport.Interval;
35
import org.gvsig.tools.dataTypes.DataType;
36
import org.gvsig.tools.evaluator.Evaluator;
37

    
38
/**
39
 * This interface represents a FeatureAttributeDescriptor in editable state. To
40
 * edit a FeatureAttributeDescriptor you have to obtain its instance of
41
 * EditableFeatureAttributeDescriptor and then perform editing operations on it.
42
 *
43
 * Once you have completed the editing you can save the changes to the original
44
 * FeatureAttributeDescriptor. This is the only way to edit a
45
 * FeatureAttributeDescriptor.
46
 */
47
public interface EditableFeatureAttributeDescriptor
48
        extends FeatureAttributeDescriptor {
49

    
50
  /**
51
   * Checks attribute integrity
52
   *
53
   * @throws
54
   * org.gvsig.fmap.dal.feature.exception.AttributeFeatureTypeIntegrityException
55
   */
56
  void checkIntegrity() throws AttributeFeatureTypeIntegrityException;
57

    
58
  @Override
59
  public EditableForeingKey getForeingKey();
60

    
61
  /**
62
   * Sets the name
63
   *
64
   * @param name to set
65
   * @return this
66
   */
67
  public EditableFeatureAttributeDescriptor setName(String name);
68

    
69
  /**
70
   * Sets the data type
71
   *
72
   * @param type one of the constants defined in {@link DataTypes}
73
   * @return this
74
   */
75
  public EditableFeatureAttributeDescriptor setDataType(int type);
76

    
77
  public EditableFeatureAttributeDescriptor setDataType(DataType dataType);
78

    
79
  public EditableFeatureAttributeDescriptor setDataProfileName(String dataProfile);
80

    
81
  /**
82
   * Sets the size.
83
   * Used for arrays (byte, char/string,...)
84
   *
85
   * @param size a size of type int
86
   * @return this
87
   *
88
   */
89
  public EditableFeatureAttributeDescriptor setSize(int size);
90

    
91
  /**
92
   * Set the required bytes to store this attribute.
93
   * 
94
   * This value is dependent of the store type.
95
   * 
96
   * @param size
97
   * @return 
98
   */
99
  public EditableFeatureAttributeDescriptor setDisplaySize(int size);
100
  
101
  /**
102
   * Sets the precision
103
   *
104
   * @param precision of type int
105
   *
106
   * @return this
107
   */
108
  public EditableFeatureAttributeDescriptor setPrecision(int precision);
109

    
110
  public EditableFeatureAttributeDescriptor setScale(int scale);
111

    
112
  /**
113
   * Sets the Class to which the related FeatureAttribute can be cast
114
   *
115
   * @param theClass Class to which the related FeatureAttribute can be cast
116
   * @return this
117
   */
118
  public EditableFeatureAttributeDescriptor setObjectClass(Class theClass);
119

    
120
  /**
121
   * Sets the number of minimum occurrences
122
   *
123
   * @param minimumOccurrences
124
   *
125
   * @return this
126
   */
127
  public EditableFeatureAttributeDescriptor setMinimumOccurrences(
128
          int minimumOccurrences);
129

    
130
  /**
131
   * Sets the maximum number of occurrences
132
   *
133
   * @param maximumOccurrences
134
   *
135
   * @return
136
   */
137
  public EditableFeatureAttributeDescriptor setMaximumOccurrences(
138
          int maximumOccurrences);
139

    
140
  /**
141
   * Sets whether the related FeatureAttribute is part of the FeatureType's
142
   * primary key
143
   *
144
   * @param isPrimaryKey true if is part of the primary key
145
   * @return this
146
   */
147
  public EditableFeatureAttributeDescriptor setIsPrimaryKey(
148
          boolean isPrimaryKey);
149

    
150
  /**
151
   * Sets the expression evaluator that the FeatureAttribute will use
152
   *
153
   * @param evaluator an implementation of DAL's Evaluator interface
154
   * @return this
155
   */
156
  public EditableFeatureAttributeDescriptor setEvaluator(Evaluator evaluator);
157

    
158
  public EditableFeatureAttributeDescriptor setAvoidCachingAvailableValues(boolean avoidCachingAvailableValues);
159
  
160
  /**
161
   * Sets the {@link FeatureAttributeEmulator} that is used to update the
162
   * presentation of a field.
163
   *
164
   * @param featureAttributeEmulator the {@link FeatureAttributeEmulator} to
165
   * set.
166
   * @return
167
   */
168
  public EditableFeatureAttributeDescriptor setFeatureAttributeEmulator(FeatureAttributeEmulator featureAttributeEmulator);
169

    
170
  public EditableFeatureAttributeDescriptor setFeatureAttributeEmulator(Expression expression);
171

    
172
  public EditableFeatureAttributeDescriptor setFeatureAttributeEmulator(String expression);
173

    
174
  /**
175
   * Sets whether the related FeatureAttribute is read only
176
   *
177
   * @param isReadOnly
178
   *
179
   * @return this
180
   */
181
  public EditableFeatureAttributeDescriptor setIsReadOnly(boolean isReadOnly);
182

    
183
  /**
184
   * Sets whether the related FeatureAttribute can have a null value
185
   *
186
   * @param allowNull a boolean value determining whether the FeatureAttribute
187
   * can be null
188
   *
189
   * @return this
190
   */
191
  public EditableFeatureAttributeDescriptor setAllowNull(boolean allowNull);
192

    
193
  /**
194
   * Sets the SRS.
195
   *
196
   * @param SRS
197
   *
198
   * @return
199
   */
200
  public EditableFeatureAttributeDescriptor setSRS(IProjection SRS);
201

    
202
  public EditableFeatureAttributeDescriptor setSRS(String SRS);
203

    
204
  public EditableFeatureAttributeDescriptor setInterval(Interval interval);
205

    
206
  /**
207
   * Sets the geometry type
208
   *
209
   * @param geometryType
210
   *
211
   * @return this
212
   * @deprecated use {@link #setGeometryType(GeometryType)} instead
213
   */
214
  public EditableFeatureAttributeDescriptor setGeometryType(int geometryType);
215

    
216
  /**
217
   * Sets the geometry subtype
218
   *
219
   * @param geometrySubType
220
   *
221
   * @return this
222
   * @deprecated use {@link #setGeometryType(GeometryType)} instead
223
   */
224
  public EditableFeatureAttributeDescriptor setGeometrySubType(
225
          int geometrySubType);
226

    
227
  /**
228
   * Sets the geometry type
229
   *
230
   * @param geometryType
231
   *
232
   * @return this
233
   */
234
  public EditableFeatureAttributeDescriptor setGeometryType(
235
          GeometryType geometryType);
236

    
237
  /**
238
   * Sets the geometry type and subtype. The format is:
239
   * <code>{geometryType}{sep}[geometrySubtype}</code> where:
240
   * <ul>
241
   * <li>geometryType is the name of the type of geometry.</li>
242
   * <li>sep is a character from ":/-!;#@".</li>
243
   * <li>geometrySubtype is the name of the subtype of geometry.</li>
244
   * </ul>
245
   *
246
   * @param geometryType
247
   * @return
248
   */
249
  public EditableFeatureAttributeDescriptor setGeometryType(String geometryType);
250

    
251
  public EditableFeatureAttributeDescriptor setGeometryType(int geometryType, int geometrySubType);
252

    
253
  /**
254
   * Sets the default value
255
   *
256
   * @param defaultValue
257
   *
258
   * @return this
259
   */
260
  public EditableFeatureAttributeDescriptor setDefaultValue(
261
          Object defaultValue);
262

    
263
  /**
264
   * Sets additional information of the attribute
265
   *
266
   * @param infoName
267
   * @param value
268
   * @return
269
   */
270
  public EditableFeatureAttributeDescriptor setAdditionalInfo(String infoName, String value);
271
  
272
  @Deprecated
273
  public EditableFeatureAttributeDescriptor setAdditionalInfo(String infoName, Object value);
274

    
275
  /**
276
   * Sets whether the related FeatureAttribute is part of the FeatureType's
277
   * primary key
278
   *
279
   * @param isAutomatic true if is part of the primary key
280
   * @return this
281
   */
282
  public EditableFeatureAttributeDescriptor setIsAutomatic(boolean isAutomatic);
283

    
284
  /**
285
   * Sets is the attribute is a temporal attribute.
286
   *
287
   * @param isTime <code>true</code> if the attribute is temporal
288
   * @return this
289
   */
290
  public EditableFeatureAttributeDescriptor setIsTime(boolean isTime);
291

    
292
  /**
293
   * Sets if this attribute is indexed in the table.
294
   *
295
   * @param isIndexed
296
   * @return this
297
   */
298
  public EditableFeatureAttributeDescriptor setIsIndexed(boolean isIndexed);
299

    
300
  public EditableFeatureAttributeDescriptor setAllowIndexDuplicateds(boolean allowDuplicateds);
301

    
302
  public EditableFeatureAttributeDescriptor setIsIndexAscending(boolean ascending);
303

    
304
  /**
305
   * Returns the attribute descriptor's name before it was changed or null if
306
   * never changed
307
   *
308
   * @return
309
   */
310
  public String getOriginalName();
311

    
312
  /**
313
   * If this attribute is of type Date, then this method set the date format set
314
   * by the data store.
315
   *
316
   * @param dateFormat
317
   * @return
318
   */
319
  public EditableFeatureAttributeDescriptor setDateFormat(DateFormat dateFormat);
320

    
321
  public EditableFeatureAttributeDescriptor set(String name, Object value);
322

    
323
  public EditableFeatureAttributeDescriptor setRoundMode(int roundMode);
324

    
325
  public EditableFeatureAttributeDescriptor setLocale(Locale locale);
326

    
327
}