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

History | View | Annotate | Download (8.86 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
  /**
159
   * Sets the {@link FeatureAttributeEmulator} that is used to update the
160
   * presentation of a field.
161
   *
162
   * @param featureAttributeEmulator the {@link FeatureAttributeEmulator} to
163
   * set.
164
   * @return
165
   */
166
  public EditableFeatureAttributeDescriptor setFeatureAttributeEmulator(FeatureAttributeEmulator featureAttributeEmulator);
167

    
168
  public EditableFeatureAttributeDescriptor setFeatureAttributeEmulator(Expression expression);
169

    
170
  public EditableFeatureAttributeDescriptor setFeatureAttributeEmulator(String expression);
171

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

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

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

    
200
  public EditableFeatureAttributeDescriptor setSRS(String SRS);
201

    
202
  public EditableFeatureAttributeDescriptor setInterval(Interval interval);
203

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

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

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

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

    
249
  public EditableFeatureAttributeDescriptor setGeometryType(int geometryType, int geometrySubType);
250

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

    
261
  /**
262
   * Sets additional information of the attribute
263
   *
264
   * @param infoName
265
   * @param value
266
   * @return
267
   */
268
  public EditableFeatureAttributeDescriptor setAdditionalInfo(String infoName, Object value);
269

    
270
  /**
271
   * Sets whether the related FeatureAttribute is part of the FeatureType's
272
   * primary key
273
   *
274
   * @param isAutomatic true if is part of the primary key
275
   * @return this
276
   */
277
  public EditableFeatureAttributeDescriptor setIsAutomatic(boolean isAutomatic);
278

    
279
  /**
280
   * Sets is the attribute is a temporal attribute.
281
   *
282
   * @param isTime <code>true</code> if the attribute is temporal
283
   * @return this
284
   */
285
  public EditableFeatureAttributeDescriptor setIsTime(boolean isTime);
286

    
287
  /**
288
   * Sets if this attribute is indexed in the table.
289
   *
290
   * @param isIndexed
291
   * @return this
292
   */
293
  public EditableFeatureAttributeDescriptor setIsIndexed(boolean isIndexed);
294

    
295
  public EditableFeatureAttributeDescriptor setAllowIndexDuplicateds(boolean allowDuplicateds);
296

    
297
  public EditableFeatureAttributeDescriptor setIsIndexAscending(boolean ascending);
298

    
299
  /**
300
   * Returns the attribute descriptor's name before it was changed or null if
301
   * never changed
302
   *
303
   * @return
304
   */
305
  public String getOriginalName();
306

    
307
  /**
308
   * If this attribute is of type Date, then this method set the date format set
309
   * by the data store.
310
   *
311
   * @param dateFormat
312
   * @return
313
   */
314
  public EditableFeatureAttributeDescriptor setDateFormat(DateFormat dateFormat);
315

    
316
  public EditableFeatureAttributeDescriptor set(String name, Object value);
317

    
318
  public EditableFeatureAttributeDescriptor setRoundMode(int roundMode);
319

    
320
  public EditableFeatureAttributeDescriptor setLocale(Locale locale);
321

    
322
}