Statistics
| Revision:

root / trunk / libraries / libDataSource / src / org / gvsig / data / vectorial / IFeatureAttributeDescriptor.java @ 20084

History | View | Annotate | Download (3.94 KB)

1
package org.gvsig.data.vectorial;
2

    
3

    
4

    
5

    
6
public interface IFeatureAttributeDescriptor {
7

    
8
        public static final String TYPE_BYTE = "BYTE";
9
        public static final String TYPE_BOOLEAN = "BOOLEAN";
10
        public static final String TYPE_INT = "INTEGER";
11
        public static final String TYPE_LONG = "LONG";
12
        public static final String TYPE_FLOAT = "FLOAT";
13
        public static final String TYPE_DOUBLE = "DOUBLE";
14
        public static final String TYPE_STRING = "STRING";
15
        public static final String TYPE_DATE = "DATE";
16
        public static final String TYPE_TIME = "TIME";
17
        public static final String TYPE_TIMESTAMP = "TIMESTAMP";
18
        public static final String TYPE_GEOMETRY = "GEOMETRY";
19
        public static final String TYPE_OBJECT = "OBJECT";
20
        public static final String TYPE_FEATURE = "FEATURE";
21
        public static final String TYPE_EXPRESSION = "EXPRESSION";
22

    
23

    
24

    
25
        /**
26
     * Returns the name of this attribute.  This is the name that can be used to
27
     * retrieve the value of an attribute and usually maps to either an XML
28
     * element name or a column name in a relational database.
29
     */
30
    String getName();
31

    
32
    /**
33
     * Returns a constant from {@link DataType}.  The return value of this method
34
     * indicates how the return values of {@link #getSize}, {@link #getPrecision}, and
35
     * {@link #getObjectClass} should be interpreted.  For attributes whose maximum
36
     * cardinality is greater than one, this should return the data type of
37
     * the individual elements of the collection.
38
     */
39
    String getDataType();
40

    
41
    /**
42
     * Returns a number that indicates the size of a given attribute.  See the documentation
43
     * for the various constants of {@link DataType} for how to interpret this value.  As an
44
     * example, when the data type is {@link DataType#STRING STRING}, this value indicates
45
     * the maximum length of the string.
46
     */
47
    int getSize();
48

    
49
    /**
50
     * For attributes of type {@link DataType#DECIMAL DECIMAL}, this returns the maximum number
51
     * of places after the decimal point.  For other types, this must always return zero.
52
     */
53
    int getPrecision();
54

    
55
    /**
56
     * For attributes of type {@link DataType#OBJECT OBJECT}, this returns the Java {@link Class}
57
     * object that class or interface that all values of this attribute can be cast to.
58
     */
59
    Class getObjectClass();
60

    
61
    /**
62
     * Returns the minimum number of occurrences of this attribute on a given
63
     * feature.  The vast majority of data sources and data consumers will only
64
     * function with this value being zero or one.  If the minimum number of
65
     * occurrences is zero, this is equivalent, in SQL terms, to the attribute
66
     * being nillable.
67
     */
68
    int getMinimumOccurrences();
69

    
70
    /**
71
     * Returns the maximum number of occurrences of this attribute on a given
72
     * feature.  The vast majority of data sources and data consumers will only
73
     * function with this value being one.  A value of {@link Integer#MAX_VALUE}
74
     * indicates that the maximum number of occurrences is unbounded.
75
     */
76
    int getMaximumOccurrences();
77

    
78
    /**
79
     * Returns {@code true} if this attribute forms all or part of the unique identifying
80
     * value for the feature it is contained by.  The primary key attributes uniquely
81
     * identify this feature from other features of the same type.  This is different
82
     * from the {@linkplain Feature#getID feature's ID}, which must uniquely identify
83
     * the {@link Feature} among all feature types.
84
     */
85
    boolean isPrimaryKey();
86
        public int ordinal();
87

    
88
        String getSRS();
89
        int getGeometryType();
90
        Object getDefaultValue();
91

    
92
        String getExpression();
93

    
94
        /**
95
         * Checks attribute integrity
96
         */
97
        boolean isValid();
98

    
99
        /**
100
         * Clone this attribute
101
         *
102
         * @return IFeatureAttributeDescriptor
103
         */
104
        IFeatureAttributeDescriptor cloneAttribute();
105

    
106
        /**
107
         * Gets Intance to use for evalue the field value
108
         */
109
        IEvaluable getEvaluator();
110

    
111
        boolean isReadOnly();
112
}