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

History | View | Annotate | Download (7.21 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 org.cresques.cts.IProjection;
28

    
29
import org.gvsig.fmap.dal.DataTypes;
30
import org.gvsig.fmap.dal.feature.exception.AttributeFeatureTypeIntegrityException;
31
import org.gvsig.fmap.geom.type.GeometryType;
32
import org.gvsig.timesupport.Interval;
33
import org.gvsig.tools.evaluator.Evaluator;
34

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

    
46
        /**
47
         * Checks attribute integrity
48
         */
49
        void checkIntegrity() throws AttributeFeatureTypeIntegrityException;
50

    
51
        /**
52
         * Sets the name
53
         * @param
54
         *                 name to set
55
         * @return this
56
         */
57
        public EditableFeatureAttributeDescriptor setName(String name);
58

    
59
        /**
60
         * Sets the data type
61
         * @param
62
         *                 type one of the constants defined in {@link DataTypes}
63
         * @return this
64
         */
65
        public EditableFeatureAttributeDescriptor setDataType(int type);
66

    
67
        /**
68
         * Sets the size
69
         * @param size
70
         *                         a size of type int
71
         * @return this
72
         *
73
         */
74
        public EditableFeatureAttributeDescriptor setSize(int size);
75

    
76
        /**
77
         * Sets the precision
78
         *
79
         * @param
80
         *                 precision of type int
81
         *
82
         * @return this
83
         */
84
        public EditableFeatureAttributeDescriptor setPrecision(int precision);
85

    
86
        /**
87
         * Sets the Class to which the related FeatureAttribute can be cast
88
         *
89
         * @param theClass
90
         *                                 Class to which the related FeatureAttribute can be cast
91
         * @return this
92
         */
93
        public EditableFeatureAttributeDescriptor setObjectClass(Class theClass);
94

    
95
        /**
96
         * Sets the number of minimum occurrences
97
         *
98
         * @param minimumOccurrences
99
         *
100
         * @return this
101
         */
102
        public EditableFeatureAttributeDescriptor setMinimumOccurrences(
103
                        int minimumOccurrences);
104

    
105
        /**
106
         * Sets the maximum number of occurrences
107
         *
108
         * @param maximumOccurrences
109
         *
110
         * @return
111
         */
112
        public EditableFeatureAttributeDescriptor setMaximumOccurrences(
113
                        int maximumOccurrences);
114

    
115
        /**
116
         * Sets whether the related FeatureAttribute is part of the FeatureType's primary key
117
         *
118
         * @param isPrimaryKey
119
         *                                 true if is part of the primary key
120
         * @return this
121
         */
122
        public EditableFeatureAttributeDescriptor setIsPrimaryKey(
123
                        boolean isPrimaryKey);
124

    
125
        /**
126
         * Sets the expression evaluator that the FeatureAttribute will use
127
         * @param evaluator
128
         *                                 an implementation of DAL's Evaluator interface
129
         * @return this
130
         */
131
        public EditableFeatureAttributeDescriptor setEvaluator(Evaluator evaluator);
132

    
133
             /**
134
         * Sets the {@link FeatureAttributeEmulator} that is used to update the 
135
         * presentation of a field.
136
         * @param featureAttributeEmulator
137
         *             the {@link FeatureAttributeEmulator} to set.
138
         */
139
        public EditableFeatureAttributeDescriptor setFeatureAttributeEmulator(FeatureAttributeEmulator featureAttributeEmulator);
140

    
141
        /**
142
         * Sets whether the related FeatureAttribute is read only
143
         *
144
         * @param isReadOnly
145
         *
146
         * @return this
147
         */
148
        public EditableFeatureAttributeDescriptor setIsReadOnly(boolean isReadOnly);
149

    
150
        /**
151
         * Sets whether the related FeatureAttribute can have a null value
152
         *
153
         * @param allowNull
154
         *                                 a boolean value determining whether the FeatureAttribute can be null
155
         *
156
         * @return this
157
         */
158
        public EditableFeatureAttributeDescriptor setAllowNull(boolean allowNull);
159

    
160
        /**
161
         * Sets the SRS.
162
         *
163
         * @param SRS
164
         *
165
         * @return
166
         */
167
        public EditableFeatureAttributeDescriptor setSRS(IProjection SRS);
168

    
169
        public EditableFeatureAttributeDescriptor setInterval(Interval interval);
170
        
171
            /**
172
     * Sets the geometry type
173
     * 
174
     * @param geometryType
175
     * 
176
     * @return this
177
     * @deprecated use {@link #setGeometryType(GeometryType)} instead
178
     */
179
    public EditableFeatureAttributeDescriptor setGeometryType(int geometryType);
180

    
181
            /**
182
     * Sets the geometry subtype
183
     * 
184
     * @param geometrySubType
185
     * 
186
     * @return this
187
     * @deprecated use {@link #setGeometryType(GeometryType)} instead
188
     */
189
        public EditableFeatureAttributeDescriptor setGeometrySubType(
190
                        int geometrySubType);
191

    
192
    /**
193
     * Sets the geometry type
194
     * 
195
     * @param geometryType
196
     * 
197
     * @return this
198
     */
199
    public EditableFeatureAttributeDescriptor setGeometryType(
200
        GeometryType geometryType);
201

    
202
    public EditableFeatureAttributeDescriptor setGeometryType(int geometrySubType, int geometryType);
203

    
204
    /**
205
     * Sets the default value
206
     * 
207
     * @param defaultValue
208
     * 
209
     * @return this
210
     */
211
        public EditableFeatureAttributeDescriptor setDefaultValue(
212
                        Object defaultValue);
213
 
214
        /**
215
         * Sets additional information of the attribute
216
         * @return TODO
217
         *
218
         *
219
         */
220
        public EditableFeatureAttributeDescriptor setAdditionalInfo(String infoName, Object value);
221

    
222
        /**
223
         * Sets whether the related FeatureAttribute is part of the FeatureType's
224
         * primary key
225
         *
226
         * @param isPrimaryKey
227
         *            true if is part of the primary key
228
         * @return this
229
         */
230
        public EditableFeatureAttributeDescriptor setIsAutomatic(
231
                        boolean isAutomatic);
232

    
233
        /**
234
         * Sets is the attribute is a temporal attribute.
235
     *
236
          * @param isTime
237
          *        <code>true</code> if the attribute is temporal
238
         * @return
239
         *         this
240
         */
241
        public EditableFeatureAttributeDescriptor setIsTime(boolean isTime);
242
        
243
        /**
244
         * Sets if this attribute is indexed in the table.
245
         * @param isIndexed
246
         * @return  this
247
         */
248
        public EditableFeatureAttributeDescriptor setIsIndexed(boolean isIndexed);
249
        
250
        public EditableFeatureAttributeDescriptor setAllowIndexDuplicateds(boolean allowDuplicateds);
251
        
252
        public EditableFeatureAttributeDescriptor setIsIndexAscending(boolean ascending);
253
        
254
        /**
255
         * Returns the attribute descriptor's name before
256
         * it was changed or null if never changed 
257
         * @return
258
         */
259
        public String getOriginalName();
260
    
261
       /**
262
         * If this attribute is of type Date, then this method set
263
         * the date format set by the data store.
264
         *
265
         * @return
266
         */
267
        public EditableFeatureAttributeDescriptor  setDateFormat(DateFormat dateFormat);
268
    
269
}