root / branches / v2_0_0_prep / libraries / libFMap_dal / src / org / gvsig / fmap / dal / feature / FeatureAttributeDescriptor.java @ 38608
History | View | Annotate | Download (5.69 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 | 33390 | cordinyana | |
7 | 25252 | jiyarza | import org.gvsig.fmap.dal.DataTypes; |
8 | 24789 | jiyarza | import org.gvsig.fmap.geom.Geometry; |
9 | 37328 | cordinyana | import org.gvsig.fmap.geom.type.GeometryType; |
10 | 33390 | cordinyana | import org.gvsig.tools.dynobject.DynField; |
11 | 23754 | jjdelcerro | import org.gvsig.tools.evaluator.Evaluator; |
12 | 19399 | vcaballero | |
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 | 33390 | cordinyana | *
|
18 | * @author gvSIG team
|
||
19 | * @version $Id$
|
||
20 | 24789 | jiyarza | */
|
21 | 33390 | cordinyana | public interface FeatureAttributeDescriptor extends DynField { |
22 | 19399 | vcaballero | |
23 | /**
|
||
24 | 24789 | jiyarza | * Returns a clone of this attribute descriptor
|
25 | 23754 | jjdelcerro | *
|
26 | * @return FeatureAttributeDescriptor
|
||
27 | 24789 | jiyarza | * A new copy of this
|
28 | 23754 | jjdelcerro | */
|
29 | public FeatureAttributeDescriptor getCopy();
|
||
30 | 19399 | vcaballero | |
31 | 23754 | jjdelcerro | /**
|
32 | 24789 | jiyarza | * Returns the name of this attribute's data type.
|
33 | 27439 | jmvivo | *
|
34 | 24789 | jiyarza | * @return
|
35 | * a string containing the name of this attribute's data type.
|
||
36 | */
|
||
37 | 23754 | jjdelcerro | public String getDataTypeName(); |
38 | 19399 | vcaballero | |
39 | 23754 | jjdelcerro | /**
|
40 | 25252 | jiyarza | * Returns a number that indicates the size of this attribute. See the
|
41 | 27439 | jmvivo | * documentation for the various constants of {@link DataTypes}
|
42 | * for how to interpret this value. As an example, when the data type is
|
||
43 | 25252 | jiyarza | * {@link DataTypes#STRING}, this value indicates the maximum length of the string.
|
44 | 27439 | jmvivo | *
|
45 | 25252 | jiyarza | * @return
|
46 | * an <code>int</code> indicating the size of the attribute.
|
||
47 | 23754 | jjdelcerro | */
|
48 | public int getSize(); |
||
49 | 19399 | vcaballero | |
50 | 23754 | jjdelcerro | /**
|
51 | 25529 | jiyarza | * For attributes of type {@link DataTypes#DOUBLE} and {@link DataTypes#FLOAT}
|
52 | 23754 | jjdelcerro | * , this returns the maximum number of places after the decimal point. For
|
53 | * other types, this must always return zero.
|
||
54 | */
|
||
55 | public int getPrecision(); |
||
56 | 19399 | vcaballero | |
57 | 23754 | jjdelcerro | /**
|
58 | 25252 | jiyarza | * For attributes of type {@link DataTypes#OBJECT},
|
59 | 23754 | jjdelcerro | * this returns the Java {@link Class} object that class or interface that
|
60 | * all values of this attribute can be cast to.
|
||
61 | */
|
||
62 | public Class getObjectClass(); |
||
63 | 19399 | vcaballero | |
64 | 23754 | jjdelcerro | /**
|
65 | * Returns the minimum number of occurrences of this attribute on a given
|
||
66 | * feature. The vast majority of data sources and data consumers will only
|
||
67 | * function with this value being zero or one. If the minimum number of
|
||
68 | * occurrences is zero, this is equivalent, in SQL terms, to the attribute
|
||
69 | * being nillable.
|
||
70 | */
|
||
71 | public int getMinimumOccurrences(); |
||
72 | 19399 | vcaballero | |
73 | 20084 | jmvivo | /**
|
74 | 23754 | jjdelcerro | * Returns the maximum number of occurrences of this attribute on a given
|
75 | * feature. The vast majority of data sources and data consumers will only
|
||
76 | * function with this value being one. A value of {@link Integer#MAX_VALUE}
|
||
77 | * indicates that the maximum number of occurrences is unbounded.
|
||
78 | 20084 | jmvivo | */
|
79 | 23754 | jjdelcerro | public int getMaximumOccurrences(); |
80 | 20084 | jmvivo | |
81 | /**
|
||
82 | 23754 | jjdelcerro | * Returns {@code true} if this attribute forms all or part of the unique identifying
|
83 | * value for the feature it is contained by. The primary key attributes uniquely
|
||
84 | * identify this feature from other features of the same type. This is different
|
||
85 | 25252 | jiyarza | * from the {@linkplain Feature#getReference()}, which must uniquely identify
|
86 | 23754 | jjdelcerro | * the {@link Feature} among all feature types.
|
87 | 20084 | jmvivo | */
|
88 | 23754 | jjdelcerro | public boolean isPrimaryKey(); |
89 | 19695 | jmvivo | |
90 | 24789 | jiyarza | /**
|
91 | * Indicates whether this attribute accepts null values.
|
||
92 | 27439 | jmvivo | *
|
93 | 24789 | jiyarza | * @return
|
94 | * true if this attribute can be null, false if not.
|
||
95 | */
|
||
96 | 23754 | jjdelcerro | public boolean allowNull(); |
97 | 27439 | jmvivo | |
98 | 20084 | jmvivo | /**
|
99 | 27439 | jmvivo | * Returns an evaluator that will be used to calculate
|
100 | 24789 | jiyarza | * the value of this attribute
|
101 | 20084 | jmvivo | */
|
102 | 23754 | jjdelcerro | public Evaluator getEvaluator();
|
103 | 20084 | jmvivo | |
104 | 24789 | jiyarza | /**
|
105 | * If this attribute is a {@link Geometry}, this method returns its
|
||
106 | * Spatial Reference System.
|
||
107 | 27439 | jmvivo | *
|
108 | 24789 | jiyarza | * @return
|
109 | * the SRS if this attribute is a {@link Geometry}, otherwise this method returns null.
|
||
110 | */
|
||
111 | 26717 | jmvivo | public IProjection getSRS();
|
112 | 20449 | jmvivo | |
113 | 37328 | cordinyana | /**
|
114 | * If this attribute is a {@link Geometry}, this method returns the specific
|
||
115 | * geometry type,
|
||
116 | * as defined in {@link Geometry.TYPES}.
|
||
117 | *
|
||
118 | * @return
|
||
119 | * One of {@link Geometry.TYPES}
|
||
120 | * @deprecated use {@link #getGeomType()} instead. To be removed in gvSIG
|
||
121 | * 2.1.
|
||
122 | */
|
||
123 | 23754 | jjdelcerro | public int getGeometryType(); |
124 | 27439 | jmvivo | |
125 | 37328 | cordinyana | /**
|
126 | * If this attribute is a {@link Geometry}, this method returns the specific
|
||
127 | * geometry subtype,
|
||
128 | * as defined in {@link Geometry.SUBTYPES}.
|
||
129 | *
|
||
130 | * @return
|
||
131 | * One of {@link Geometry.SUBTYPES}
|
||
132 | * @deprecated use {@link #getGeomType()} instead. To be removed in gvSIG
|
||
133 | * 2.1.
|
||
134 | */
|
||
135 | 26911 | jpiera | public int getGeometrySubType(); |
136 | 20907 | jmvivo | |
137 | 37328 | cordinyana | /**
|
138 | * Returns the {@link GeometryType} of the attribute if it is a geometry.
|
||
139 | *
|
||
140 | * @return the geometry type
|
||
141 | */
|
||
142 | public GeometryType getGeomType();
|
||
143 | |||
144 | 24789 | jiyarza | /**
|
145 | 27439 | jmvivo | * If this attribute is of type Date, then this method returns
|
146 | 24789 | jiyarza | * the date format set by the data store.
|
147 | 27439 | jmvivo | *
|
148 | 24789 | jiyarza | * @return
|
149 | * a date format
|
||
150 | */
|
||
151 | 23754 | jjdelcerro | public DateFormat getDateFormat(); |
152 | |||
153 | 24789 | jiyarza | /**
|
154 | * Returns this attribute relative position within the {@link Feature}.
|
||
155 | 27439 | jmvivo | *
|
156 | 24789 | jiyarza | * @return
|
157 | 27439 | jmvivo | * an index
|
158 | 24789 | jiyarza | */
|
159 | 23754 | jjdelcerro | public int getIndex(); |
160 | |||
161 | 27439 | jmvivo | /**
|
162 | * Returns additional information of the attribute
|
||
163 | *
|
||
164 | * @return info
|
||
165 | *
|
||
166 | */
|
||
167 | public Object getAdditionalInfo(String infoName); |
||
168 | |||
169 | /**
|
||
170 | 37297 | jpiera | * Returns if value is created automatically by the source
|
171 | 27439 | jmvivo | */
|
172 | public boolean isAutomatic(); |
||
173 | |||
174 | 37297 | jpiera | /**
|
175 | * Gets if the attribute is a temporal attribute.
|
||
176 | * @return
|
||
177 | * <code>true</code> if is a temporal attribute
|
||
178 | */
|
||
179 | public boolean isTime(); |
||
180 | |||
181 | /**
|
||
182 | * Gets if the attribute has a {@link FeatureAttributeGetter}.
|
||
183 | * @return
|
||
184 | * a FeatureAttributeGetter or null.
|
||
185 | */
|
||
186 | public FeatureAttributeGetter getFeatureAttributeGetter();
|
||
187 | |||
188 | /**
|
||
189 | * Sets the {@link FeatureAttributeGetter} that is used to update the
|
||
190 | * presentation of a field.
|
||
191 | * @param featureAttributeGetter
|
||
192 | * the {@link FeatureAttributeGetter} to set.
|
||
193 | */
|
||
194 | public void setFeatureAttributeGetter(FeatureAttributeGetter featureAttributeGetter); |
||
195 | 19399 | vcaballero | } |