root / branches / v2_0_0_prep / libraries / libFMap_dal / src / org / gvsig / fmap / dal / feature / FeatureAttributeDescriptor.java @ 24496
History | View | Annotate | Download (3.34 KB)
1 |
package org.gvsig.fmap.dal.feature; |
---|---|
2 |
|
3 |
import java.text.DateFormat; |
4 |
|
5 |
import org.gvsig.tools.evaluator.Evaluator; |
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
public interface FeatureAttributeDescriptor { |
12 |
|
13 |
/**
|
14 |
* Clone this attribute
|
15 |
*
|
16 |
* @return FeatureAttributeDescriptor
|
17 |
*/
|
18 |
public FeatureAttributeDescriptor getCopy();
|
19 |
|
20 |
|
21 |
/**
|
22 |
* Returns the name of this attribute. This is the name that can be used to
|
23 |
* retrieve the value of an attribute and usually maps to either an XML
|
24 |
* element name or a column name in a relational database.
|
25 |
*/
|
26 |
public String getName(); |
27 |
|
28 |
/**
|
29 |
* Returns a constant from {@link FeatureAttributeDescriptor}. The return
|
30 |
* value of this method indicates how the return values of {@link #getSize},
|
31 |
* {@link #getPrecision}, and {@link #getObjectClass} should be interpreted.
|
32 |
* For attributes whose maximum cardinality is greater than one, this should
|
33 |
* return the data type of the individual elements of the collection.
|
34 |
*/
|
35 |
public int getDataType(); |
36 |
|
37 |
public String getDataTypeName(); |
38 |
|
39 |
/**
|
40 |
* Returns a number that indicates the size of a given attribute. See the
|
41 |
* documentation for the various constants of
|
42 |
* {@link FeatureAttributeDescriptor} for how to interpret this value. As an
|
43 |
* example, when the data type is {@link FeatureAttributeDescriptor#STRING
|
44 |
* STRING}, this value indicates the maximum length of the string.
|
45 |
*/
|
46 |
public int getSize(); |
47 |
|
48 |
/**
|
49 |
* For attributes of type {@link FeatureAttributeDescriptor#DECIMAL DECIMAL}
|
50 |
* , this returns the maximum number of places after the decimal point. For
|
51 |
* other types, this must always return zero.
|
52 |
*/
|
53 |
public int getPrecision(); |
54 |
|
55 |
/**
|
56 |
* For attributes of type {@link FeatureAttributeDescriptor#OBJECT OBJECT},
|
57 |
* this returns the Java {@link Class} object that class or interface that
|
58 |
* all values of this attribute can be cast to.
|
59 |
*/
|
60 |
public Class getObjectClass(); |
61 |
|
62 |
/**
|
63 |
* Returns the minimum number of occurrences of this attribute on a given
|
64 |
* feature. The vast majority of data sources and data consumers will only
|
65 |
* function with this value being zero or one. If the minimum number of
|
66 |
* occurrences is zero, this is equivalent, in SQL terms, to the attribute
|
67 |
* being nillable.
|
68 |
*/
|
69 |
public int getMinimumOccurrences(); |
70 |
|
71 |
/**
|
72 |
* Returns the maximum number of occurrences of this attribute on a given
|
73 |
* feature. The vast majority of data sources and data consumers will only
|
74 |
* function with this value being one. A value of {@link Integer#MAX_VALUE}
|
75 |
* indicates that the maximum number of occurrences is unbounded.
|
76 |
*/
|
77 |
public int getMaximumOccurrences(); |
78 |
|
79 |
/**
|
80 |
* Returns {@code true} if this attribute forms all or part of the unique identifying
|
81 |
* value for the feature it is contained by. The primary key attributes uniquely
|
82 |
* identify this feature from other features of the same type. This is different
|
83 |
* from the {@linkplain Feature#getID feature's ID}, which must uniquely identify
|
84 |
* the {@link Feature} among all feature types.
|
85 |
*/
|
86 |
public boolean isPrimaryKey(); |
87 |
|
88 |
public boolean allowNull(); |
89 |
/**
|
90 |
* Gets Intance to use for evalue the field value
|
91 |
*/
|
92 |
public Evaluator getEvaluator();
|
93 |
|
94 |
public boolean isReadOnly(); |
95 |
|
96 |
public String getSRS(); |
97 |
|
98 |
public int getGeometryType(); |
99 |
|
100 |
public Object getDefaultValue(); |
101 |
|
102 |
public DateFormat getDateFormat(); |
103 |
|
104 |
public int getIndex(); |
105 |
|
106 |
} |