Statistics
| Revision:

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

History | View | Annotate | Download (3.48 KB)

1
package org.gvsig.data.vectorial;
2

    
3
import org.cresques.cts.IProjection;
4

    
5

    
6

    
7
public interface IFeatureAttributeDescriptor {
8

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

    
21

    
22

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

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

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

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

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

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

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

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

    
86
        IProjection getSRS();
87
        int getGeometryType();
88
        Object getDefaultValue();
89

    
90
}