Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libFMap_dal / src / org / gvsig / fmap / dal / feature / FeatureAttributeDescriptor.java @ 37297

History | View | Annotate | Download (5.19 KB)

1
package org.gvsig.fmap.dal.feature;
2

    
3
import java.text.DateFormat;
4

    
5
import org.cresques.cts.IProjection;
6

    
7
import org.gvsig.fmap.dal.DataTypes;
8
import org.gvsig.fmap.geom.Geometry;
9
import org.gvsig.tools.dynobject.DynField;
10
import org.gvsig.tools.evaluator.Evaluator;
11

    
12
/**
13
 * A feature attribute descriptor contains information about
14
 * one of the attributes in a feature, such as its name, data type
15
 * or precision.
16
 * 
17
 * @author gvSIG team
18
 * @version $Id$
19
 */
20
public interface FeatureAttributeDescriptor extends DynField {
21

    
22
        /**
23
         * Returns a clone of this attribute descriptor
24
         *
25
         * @return FeatureAttributeDescriptor
26
         *                                                 A new copy of this
27
         */
28
        public FeatureAttributeDescriptor getCopy();
29

    
30
        /**
31
         * Returns the name of this attribute's data type.
32
         *
33
         * @return
34
         *                 a string containing the name of this attribute's data type.
35
         */
36
        public String getDataTypeName();
37

    
38
        /**
39
         * Returns a number that indicates the size of this attribute. See the
40
         * documentation for the various constants of {@link DataTypes}
41
         * for how to interpret this value. As an example, when the data type is
42
         * {@link DataTypes#STRING}, this value indicates the maximum length of the string.
43
         *
44
         * @return
45
         *                 an <code>int</code> indicating the size of the attribute.
46
         */
47
        public int getSize();
48

    
49
        /**
50
         * For attributes of type {@link DataTypes#DOUBLE} and {@link DataTypes#FLOAT}
51
         * , this returns the maximum number of places after the decimal point. For
52
         * other types, this must always return zero.
53
         */
54
        public int getPrecision();
55

    
56
        /**
57
         * For attributes of type {@link DataTypes#OBJECT},
58
         * this returns the Java {@link Class} object that class or interface that
59
         * all values of this attribute can be cast to.
60
         */
61
        public Class getObjectClass();
62

    
63
        /**
64
         * Returns the minimum number of occurrences of this attribute on a given
65
         * feature.  The vast majority of data sources and data consumers will only
66
         * function with this value being zero or one.  If the minimum number of
67
         * occurrences is zero, this is equivalent, in SQL terms, to the attribute
68
         * being nillable.
69
         */
70
        public int getMinimumOccurrences();
71

    
72
        /**
73
         * Returns the maximum number of occurrences of this attribute on a given
74
         * feature.  The vast majority of data sources and data consumers will only
75
         * function with this value being one.  A value of {@link Integer#MAX_VALUE}
76
         * indicates that the maximum number of occurrences is unbounded.
77
         */
78
        public int getMaximumOccurrences();
79

    
80
        /**
81
         * Returns {@code true} if this attribute forms all or part of the unique identifying
82
         * value for the feature it is contained by.  The primary key attributes uniquely
83
         * identify this feature from other features of the same type.  This is different
84
         * from the {@linkplain Feature#getReference()}, which must uniquely identify
85
         * the {@link Feature} among all feature types.
86
         */
87
        public boolean isPrimaryKey();
88

    
89
        /**
90
         * Indicates whether this attribute accepts null values.
91
         *
92
         * @return
93
         *                 true if this attribute can be null, false if not.
94
         */
95
        public boolean allowNull();
96

    
97
        /**
98
         * Returns an evaluator that will be used to calculate
99
         * the value of this attribute
100
         */
101
        public Evaluator getEvaluator();
102

    
103
        /**
104
         * If this attribute is a {@link Geometry}, this method returns its
105
         * Spatial Reference System.
106
         *
107
         * @return
108
         *                 the SRS if this attribute is a {@link Geometry}, otherwise this method returns null.
109
         */
110
        public IProjection getSRS();
111

    
112
        /**
113
         * If this attribute is a {@link Geometry}, this method returns the specific geometry type,
114
         * as defined in {@link Geometry.TYPES}.
115
         *
116
         * @return
117
         *                 One of {@link Geometry.TYPES}
118
         */
119
        public int getGeometryType();
120

    
121
        /**
122
         * If this attribute is a {@link Geometry}, this method returns the specific geometry subtype,
123
         * as defined in {@link Geometry.SUBTYPES}.
124
         *
125
         * @return
126
         *                 One of {@link Geometry.SUBTYPES}
127
         */
128
        public int getGeometrySubType();
129

    
130
        /**
131
         * If this attribute is of type Date, then this method returns
132
         * the date format set by the data store.
133
         *
134
         * @return
135
         *                 a date format
136
         */
137
        public DateFormat getDateFormat();
138

    
139
        /**
140
         * Returns this attribute relative position within the {@link Feature}.
141
         *
142
         * @return
143
         *                 an index
144
         */
145
        public int getIndex();
146

    
147
        /**
148
         * Returns additional information of the attribute
149
         *
150
         * @return info
151
         *
152
         */
153
        public Object getAdditionalInfo(String infoName);
154

    
155
        /**
156
         * Returns if value is created automatically by the source
157
         */
158
        public boolean isAutomatic();
159

    
160
        /**
161
         * Gets if the attribute is a temporal attribute.
162
         * @return
163
         *         <code>true</code> if is a temporal attribute
164
         */
165
        public boolean isTime();  
166

    
167
        /**
168
         * Gets if the attribute has a {@link FeatureAttributeGetter}.
169
         * @return
170
         *             a FeatureAttributeGetter or null.
171
         */
172
        public FeatureAttributeGetter getFeatureAttributeGetter();
173
        
174
        /**
175
         * Sets the {@link FeatureAttributeGetter} that is used to update the 
176
         * presentation of a field.
177
         * @param featureAttributeGetter
178
         *             the {@link FeatureAttributeGetter} to set.
179
         */
180
        public void setFeatureAttributeGetter(FeatureAttributeGetter featureAttributeGetter);
181
}