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 / FeatureAttributeDescriptor.java @ 44262

History | View | Annotate | Download (8.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

    
28
import org.cresques.cts.IProjection;
29

    
30
import org.gvsig.fmap.dal.DataTypes;
31
import org.gvsig.fmap.geom.Geometry;
32
import org.gvsig.fmap.geom.type.GeometryType;
33
import org.gvsig.timesupport.Interval;
34
import org.gvsig.tools.dynobject.DynField_v2;
35
import org.gvsig.tools.evaluator.Evaluator;
36

    
37
/**
38
 * A feature attribute descriptor contains information about
39
 * one of the attributes in a feature, such as its name, data type
40
 * or precision.
41
 * 
42
 * @author gvSIG team
43
 * @version $Id$
44
 */
45
public interface FeatureAttributeDescriptor extends DynField_v2 {
46

    
47
        /**
48
         * Returns a clone of this attribute descriptor
49
         *
50
         * @return FeatureAttributeDescriptor
51
         *                                                 A new copy of this
52
         */
53
        public FeatureAttributeDescriptor getCopy();
54

    
55
        /**
56
         * Returns the name of this attribute's data type.
57
         *
58
         * @return
59
         *                 a string containing the name of this attribute's data type.
60
         */
61
        public String getDataTypeName();
62

    
63
        public String getDataProfileName();
64
        
65
        /**
66
         * Returns a number that indicates the size of this attribute. See the
67
         * documentation for the various constants of {@link DataTypes}
68
         * for how to interpret this value. As an example, when the data type is
69
         * {@link DataTypes#STRING}, this value indicates the maximum length of the string.
70
         *
71
         * @return
72
         *                 an <code>int</code> indicating the size of the attribute.
73
         */
74
        public int getSize();
75

    
76
        /**
77
         * For attributes of type {@link DataTypes#DOUBLE} and {@link DataTypes#FLOAT}
78
         * , this returns the maximum number of places after the decimal point. For
79
         * other types, this must always return zero.
80
         */
81
        public int getPrecision();
82

    
83
        /**
84
         * For attributes of type {@link DataTypes#OBJECT},
85
         * this returns the Java {@link Class} object that class or interface that
86
         * all values of this attribute can be cast to.
87
         */
88
        public Class getObjectClass();
89

    
90
        /**
91
         * Returns the minimum number of occurrences of this attribute on a given
92
         * feature.  The vast majority of data sources and data consumers will only
93
         * function with this value being zero or one.  If the minimum number of
94
         * occurrences is zero, this is equivalent, in SQL terms, to the attribute
95
         * being nillable.
96
         */
97
        public int getMinimumOccurrences();
98

    
99
        /**
100
         * Returns the maximum number of occurrences of this attribute on a given
101
         * feature.  The vast majority of data sources and data consumers will only
102
         * function with this value being one.  A value of {@link Integer#MAX_VALUE}
103
         * indicates that the maximum number of occurrences is unbounded.
104
         */
105
        public int getMaximumOccurrences();
106

    
107
        /**
108
         * Returns {@code true} if this attribute forms all or part of the unique identifying
109
         * value for the feature it is contained by.  The primary key attributes uniquely
110
         * identify this feature from other features of the same type.  This is different
111
         * from the {@linkplain Feature#getReference()}, which must uniquely identify
112
         * the {@link Feature} among all feature types.
113
         */
114
        public boolean isPrimaryKey();
115

    
116
        /**
117
         * Indicates whether this attribute accepts null values.
118
         *
119
         * @return
120
         *                 true if this attribute can be null, false if not.
121
         */
122
        public boolean allowNull();
123

    
124
        /**
125
         * Returns an evaluator that will be used to calculate
126
         * the value of this attribute
127
         */
128
        public Evaluator getEvaluator();
129

    
130
        /**
131
         * If this attribute is a {@link Geometry}, this method returns its
132
         * Spatial Reference System.
133
         *
134
         * @return
135
         *                 the SRS if this attribute is a {@link Geometry}, otherwise this method returns null.
136
         */
137
        public IProjection getSRS();
138

    
139
            /**
140
     * If this attribute is a {@link Geometry}, this method returns the specific
141
     * geometry type,
142
     * as defined in {@link Geometry.TYPES}.
143
     * 
144
     * @return
145
     *         One of {@link Geometry.TYPES}
146
     * @deprecated use {@link #getGeomType()} instead. To be removed in gvSIG
147
     *             2.1.
148
     */
149
        public int getGeometryType();
150

    
151
            /**
152
     * If this attribute is a {@link Geometry}, this method returns the specific
153
     * geometry subtype,
154
     * as defined in {@link Geometry.SUBTYPES}.
155
     * 
156
     * @return
157
     *         One of {@link Geometry.SUBTYPES}
158
     * @deprecated use {@link #getGeomType()} instead. To be removed in gvSIG
159
     *             2.1.
160
     */
161
        public int getGeometrySubType();
162

    
163
    /**
164
     * Returns the {@link GeometryType} of the attribute if it is a geometry.
165
     * 
166
     * @return the geometry type
167
     */
168
    public GeometryType getGeomType();
169

    
170
        /**
171
         * If this attribute is of type Date, then this method returns
172
         * the date format set by the data store.
173
         *
174
         * @return
175
         *                 a date format
176
         */
177
        public DateFormat getDateFormat();
178

    
179
        /**
180
         * Returns this attribute relative position within the {@link Feature}.
181
         *
182
         * @return
183
         *                 an index
184
         */
185
        public int getIndex();
186

    
187
        /**
188
         * Returns additional information of the attribute
189
         *
190
         * @return info
191
         *
192
         */
193
        public Object getAdditionalInfo(String infoName);
194

    
195
        /**
196
         * Returns if value is created automatically by the source
197
         */
198
        public boolean isAutomatic();
199

    
200
        /**
201
         * Gets if the attribute is a temporal attribute.
202
         * @return
203
         *         <code>true</code> if is a temporal attribute
204
         */
205
        public boolean isTime();  
206

    
207
        public Interval getInterval();
208
        
209
        /**
210
         * Return true if the attribute has and index in the table.
211
         * 
212
         * @return true if indexed.
213
         */
214
        public boolean isIndexed();
215
        public boolean allowIndexDuplicateds();
216
        public boolean isIndexAscending();
217
        
218
        public boolean isForeingKey();
219
            
220
        public ForeingKey getForeingKey();
221
        /**
222
         * Gets if the attribute has a {@link FeatureAttributeGetter}.
223
         * @return
224
         *             a FeatureAttributeGetter or null.
225
         * @deprecated use getFeatureAttributeGetterAndSetter
226
         */
227
        public FeatureAttributeGetter getFeatureAttributeGetter();
228
        
229
        /**
230
         * Sets the {@link FeatureAttributeGetter} that is used to update the 
231
         * presentation of a field.
232
         * @param featureAttributeGetter
233
         *             the {@link FeatureAttributeGetter} to set.
234
         * @deprecated use setFeatureAttributeGetterAndSetter
235
         */
236
        public void setFeatureAttributeGetter(FeatureAttributeGetter featureAttributeGetter);
237

    
238
             /**
239
         * Gets the attribute emulator associatted {@link FeatureAttributeEmulator} to this attribute.
240
         * @return
241
         *             a FeatureAttributeEmulator or null.
242
         */
243
        public FeatureAttributeEmulator getFeatureAttributeEmulator();
244
        
245
        /**
246
         * Return true if the attribute has an evaluator o an emulator.
247
         * @return 
248
         */
249
        public boolean isComputed();
250
        
251
        /**
252
         * Return the store associated to this attribute descriptor.
253
         * 
254
         * @return the FeatureStore of the attribute descriptor.
255
         */
256
        public FeatureStore getStore();   
257
        
258
        public FeatureType getFeatureType();
259
            
260
        public String[] getRequiredFieldNames();
261
        
262
        public void recentUsed();
263
}