Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_dal / src / org / gvsig / fmap / dal / feature / FeatureAttributeDescriptor.java @ 28782

History | View | Annotate | Download (5.62 KB)

1 24496 jmvivo
package org.gvsig.fmap.dal.feature;
2 19399 vcaballero
3 23754 jjdelcerro
import java.text.DateFormat;
4 19399 vcaballero
5 26717 jmvivo
import org.cresques.cts.IProjection;
6 25252 jiyarza
import org.gvsig.fmap.dal.DataTypes;
7 24789 jiyarza
import org.gvsig.fmap.geom.Geometry;
8 23754 jjdelcerro
import org.gvsig.tools.evaluator.Evaluator;
9 19399 vcaballero
10
11 20412 vcaballero
12 23123 jmvivo
13 24789 jiyarza
/**
14 27439 jmvivo
 * A feature attribute descriptor contains information about
15 25252 jiyarza
 * one of the attributes in a feature, such as its name, data type
16
 * or precision.
17 24789 jiyarza
 *
18
 *
19
 */
20 21045 jmvivo
public interface FeatureAttributeDescriptor {
21 19399 vcaballero
22
        /**
23 24789 jiyarza
         * Returns a clone of this attribute descriptor
24 23754 jjdelcerro
         *
25
         * @return FeatureAttributeDescriptor
26 24789 jiyarza
         *                                                 A new copy of this
27 23754 jjdelcerro
         */
28
        public FeatureAttributeDescriptor getCopy();
29 19399 vcaballero
30
31 23754 jjdelcerro
        /**
32
         * Returns the name of this attribute.  This is the name that can be used to
33
         * retrieve the value of an attribute and usually maps to either an XML
34
         * element name or a column name in a relational database.
35
         */
36
        public String getName();
37 19399 vcaballero
38 23754 jjdelcerro
        /**
39 25528 jiyarza
         * Returns a constant from {@link DataTypes}. The return
40 23754 jjdelcerro
         * value of this method indicates how the return values of {@link #getSize},
41
         * {@link #getPrecision}, and {@link #getObjectClass} should be interpreted.
42
         * For attributes whose maximum cardinality is greater than one, this should
43
         * return the data type of the individual elements of the collection.
44 27439 jmvivo
         *
45 25252 jiyarza
         * @return
46
         *                 an <code>int</code> indicating the data type as defined in {@link DataTypes}.
47 23754 jjdelcerro
         */
48
        public int getDataType();
49 19399 vcaballero
50 24789 jiyarza
        /**
51
         * Returns the name of this attribute's data type.
52 27439 jmvivo
         *
53 24789 jiyarza
         * @return
54
         *                 a string containing the name of this attribute's data type.
55
         */
56 23754 jjdelcerro
        public String getDataTypeName();
57 19399 vcaballero
58 23754 jjdelcerro
        /**
59 25252 jiyarza
         * Returns a number that indicates the size of this attribute. See the
60 27439 jmvivo
         * documentation for the various constants of {@link DataTypes}
61
         * for how to interpret this value. As an example, when the data type is
62 25252 jiyarza
         * {@link DataTypes#STRING}, this value indicates the maximum length of the string.
63 27439 jmvivo
         *
64 25252 jiyarza
         * @return
65
         *                 an <code>int</code> indicating the size of the attribute.
66 23754 jjdelcerro
         */
67
        public int getSize();
68 19399 vcaballero
69 23754 jjdelcerro
        /**
70 25529 jiyarza
         * For attributes of type {@link DataTypes#DOUBLE} and {@link DataTypes#FLOAT}
71 23754 jjdelcerro
         * , this returns the maximum number of places after the decimal point. For
72
         * other types, this must always return zero.
73
         */
74
        public int getPrecision();
75 19399 vcaballero
76 23754 jjdelcerro
        /**
77 25252 jiyarza
         * For attributes of type {@link DataTypes#OBJECT},
78 23754 jjdelcerro
         * this returns the Java {@link Class} object that class or interface that
79
         * all values of this attribute can be cast to.
80
         */
81
        public Class getObjectClass();
82 19399 vcaballero
83 23754 jjdelcerro
        /**
84
         * Returns the minimum number of occurrences of this attribute on a given
85
         * feature.  The vast majority of data sources and data consumers will only
86
         * function with this value being zero or one.  If the minimum number of
87
         * occurrences is zero, this is equivalent, in SQL terms, to the attribute
88
         * being nillable.
89
         */
90
        public int getMinimumOccurrences();
91 19399 vcaballero
92 20084 jmvivo
        /**
93 23754 jjdelcerro
         * Returns the maximum number of occurrences of this attribute on a given
94
         * feature.  The vast majority of data sources and data consumers will only
95
         * function with this value being one.  A value of {@link Integer#MAX_VALUE}
96
         * indicates that the maximum number of occurrences is unbounded.
97 20084 jmvivo
         */
98 23754 jjdelcerro
        public int getMaximumOccurrences();
99 20084 jmvivo
100
        /**
101 23754 jjdelcerro
         * Returns {@code true} if this attribute forms all or part of the unique identifying
102
         * value for the feature it is contained by.  The primary key attributes uniquely
103
         * identify this feature from other features of the same type.  This is different
104 25252 jiyarza
         * from the {@linkplain Feature#getReference()}, which must uniquely identify
105 23754 jjdelcerro
         * the {@link Feature} among all feature types.
106 20084 jmvivo
         */
107 23754 jjdelcerro
        public boolean isPrimaryKey();
108 19695 jmvivo
109 24789 jiyarza
        /**
110
         * Indicates whether this attribute accepts null values.
111 27439 jmvivo
         *
112 24789 jiyarza
         * @return
113
         *                 true if this attribute can be null, false if not.
114
         */
115 23754 jjdelcerro
        public boolean allowNull();
116 27439 jmvivo
117 20084 jmvivo
        /**
118 27439 jmvivo
         * Returns an evaluator that will be used to calculate
119 24789 jiyarza
         * the value of this attribute
120 20084 jmvivo
         */
121 23754 jjdelcerro
        public Evaluator getEvaluator();
122 20084 jmvivo
123 24789 jiyarza
        /**
124
         * Indicates whether this attribute is read only or not.
125 27439 jmvivo
         *
126 24789 jiyarza
         * @return
127
         *                 true if this attribute is read only, false if not.
128
         */
129 23754 jjdelcerro
        public boolean isReadOnly();
130 20412 vcaballero
131 24789 jiyarza
        /**
132
         * If this attribute is a {@link Geometry}, this method returns its
133
         * Spatial Reference System.
134 27439 jmvivo
         *
135 24789 jiyarza
         * @return
136
         *                 the SRS if this attribute is a {@link Geometry}, otherwise this method returns null.
137
         */
138 26717 jmvivo
        public IProjection getSRS();
139 20449 jmvivo
140 24789 jiyarza
        /**
141
         * If this attribute is a {@link Geometry}, this method returns the specific geometry type,
142
         * as defined in {@link Geometry.TYPES}.
143 27439 jmvivo
         *
144 24789 jiyarza
         * @return
145
         *                 One of {@link Geometry.TYPES}
146
         */
147 23754 jjdelcerro
        public int getGeometryType();
148 27439 jmvivo
149 26911 jpiera
        /**
150
         * If this attribute is a {@link Geometry}, this method returns the specific geometry subtype,
151
         * as defined in {@link Geometry.SUBTYPES}.
152 27439 jmvivo
         *
153 26911 jpiera
         * @return
154
         *                 One of {@link Geometry.SUBTYPES}
155
         */
156
        public int getGeometrySubType();
157 20907 jmvivo
158 24789 jiyarza
        /**
159
         * Returns this attribute default value, or null if no
160
         * default value has been defined.
161 27439 jmvivo
         *
162 24789 jiyarza
         * @return
163
         *                 this attribute default value, or null if no default
164 27439 jmvivo
         * value has been defined.
165 24789 jiyarza
         */
166 23754 jjdelcerro
        public Object getDefaultValue();
167 22663 jmvivo
168 24789 jiyarza
        /**
169 27439 jmvivo
         * If this attribute is of type Date, then this method returns
170 24789 jiyarza
         * the date format set by the data store.
171 27439 jmvivo
         *
172 24789 jiyarza
         * @return
173
         *                 a date format
174
         */
175 23754 jjdelcerro
        public DateFormat getDateFormat();
176
177 24789 jiyarza
        /**
178
         * Returns this attribute relative position within the {@link Feature}.
179 27439 jmvivo
         *
180 24789 jiyarza
         * @return
181 27439 jmvivo
         *                 an index
182 24789 jiyarza
         */
183 23754 jjdelcerro
        public int getIndex();
184
185 27439 jmvivo
        /**
186
         * Returns additional information of the attribute
187
         *
188
         * @return info
189
         *
190
         */
191
        public Object getAdditionalInfo(String infoName);
192
193
        /**
194
         * Reaturns if value is created automaticaly by the source
195
         */
196
        public boolean isAutomatic();
197
198 19399 vcaballero
}