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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
177

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

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

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

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

    
228
        /**
229
         * Sets is the attribute is a temporal attribute.
230
     *
231
          * @param isTime
232
          *        <code>true</code> if the attribute is temporal
233
         * @return
234
         *         this
235
         */
236
        public EditableFeatureAttributeDescriptor setIsTime(boolean isTime);
237
        
238
        /**
239
         * Returns the attribute descriptor's name before
240
         * it was changed or null if never changed 
241
         * @return
242
         */
243
    public String getOriginalName();
244
}