root / branches / Mobile_Compatible_Hito_1 / libFMap_data / src / org / gvsig / data / vectorial / FeatureAttributeDescriptor.java @ 21563
History | View | Annotate | Download (4.04 KB)
1 |
package org.gvsig.data.vectorial; |
---|---|
2 |
|
3 |
import java.util.HashMap; |
4 |
|
5 |
|
6 |
|
7 |
|
8 |
public interface FeatureAttributeDescriptor { |
9 |
|
10 |
public static final String TYPE_BYTE = "BYTE"; |
11 |
public static final String TYPE_BOOLEAN = "BOOLEAN"; |
12 |
public static final String TYPE_INT = "INTEGER"; |
13 |
public static final String TYPE_LONG = "LONG"; |
14 |
public static final String TYPE_FLOAT = "FLOAT"; |
15 |
public static final String TYPE_DOUBLE = "DOUBLE"; |
16 |
public static final String TYPE_STRING = "STRING"; |
17 |
public static final String TYPE_DATE = "DATE"; |
18 |
public static final String TYPE_TIME = "TIME"; |
19 |
public static final String TYPE_TIMESTAMP = "TIMESTAMP"; |
20 |
public static final String TYPE_GEOMETRY = "GEOMETRY"; |
21 |
public static final String TYPE_OBJECT = "OBJECT"; |
22 |
public static final String TYPE_FEATURE = "FEATURE"; |
23 |
|
24 |
|
25 |
|
26 |
/**
|
27 |
* Returns the name of this attribute. This is the name that can be used to
|
28 |
* retrieve the value of an attribute and usually maps to either an XML
|
29 |
* element name or a column name in a relational database.
|
30 |
*/
|
31 |
String getName();
|
32 |
|
33 |
/**
|
34 |
* Returns a constant from {@link DataType}. The return value of this method
|
35 |
* indicates how the return values of {@link #getSize}, {@link #getPrecision}, and
|
36 |
* {@link #getObjectClass} should be interpreted. For attributes whose maximum
|
37 |
* cardinality is greater than one, this should return the data type of
|
38 |
* the individual elements of the collection.
|
39 |
*/
|
40 |
String getDataType();
|
41 |
|
42 |
/**
|
43 |
* Returns a number that indicates the size of a given attribute. See the documentation
|
44 |
* for the various constants of {@link DataType} for how to interpret this value. As an
|
45 |
* example, when the data type is {@link DataType#STRING STRING}, this value indicates
|
46 |
* the maximum length of the string.
|
47 |
*/
|
48 |
int getSize();
|
49 |
|
50 |
/**
|
51 |
* For attributes of type {@link DataType#DECIMAL DECIMAL}, this returns the maximum number
|
52 |
* of places after the decimal point. For other types, this must always return zero.
|
53 |
*/
|
54 |
int getPrecision();
|
55 |
|
56 |
/**
|
57 |
* For attributes of type {@link DataType#OBJECT OBJECT}, this returns the Java {@link Class}
|
58 |
* object that class or interface that all values of this attribute can be cast to.
|
59 |
*/
|
60 |
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 |
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 |
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 |
boolean isPrimaryKey();
|
87 |
public int ordinal(); |
88 |
|
89 |
String getSRS();
|
90 |
int getGeometryType();
|
91 |
Object getDefaultValue();
|
92 |
|
93 |
String getExpression();
|
94 |
|
95 |
/**
|
96 |
* Checks attribute integrity
|
97 |
*/
|
98 |
boolean isValid();
|
99 |
|
100 |
/**
|
101 |
* Clone this attribute
|
102 |
*
|
103 |
* @return FeatureAttributeDescriptor
|
104 |
*/
|
105 |
FeatureAttributeDescriptor cloneAttribute(); |
106 |
|
107 |
/**
|
108 |
* Gets Intance to use for evalue the field value
|
109 |
*/
|
110 |
ExpressionEvaluator getEvaluator(); |
111 |
|
112 |
boolean isReadOnly();
|
113 |
|
114 |
boolean isEvaluated();
|
115 |
|
116 |
void editing();
|
117 |
void cancelEditing();
|
118 |
|
119 |
boolean isFromFeatureType(FeatureType featureType);
|
120 |
} |