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