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

History | View | Annotate | Download (6.98 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.tools.evaluator.Evaluator;
33

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
178

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

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

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

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

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