Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libFMap_dal / src / org / gvsig / fmap / dal / feature / EditableFeatureType.java @ 38608

History | View | Annotate | Download (3.53 KB)

1 24496 jmvivo
package org.gvsig.fmap.dal.feature;
2 23754 jjdelcerro
3 24789 jiyarza
import org.gvsig.fmap.dal.DataTypes;
4 23754 jjdelcerro
import org.gvsig.tools.evaluator.Evaluator;
5
6 24789 jiyarza
/**
7
 * This interface represents a FeatureType in editable state.
8
 * To edit a FeatureType you have to obtain its instance of
9
 * EditableFeatureType and then perform editing operations on it.
10
 *
11 25481 jiyarza
 * Once you have completed the editing you can save the changes to the original
12 25040 jiyarza
 * FeatureType. This is the only way to edit a FeatureType.
13 24789 jiyarza
 */
14
public interface EditableFeatureType extends FeatureType {
15 23754 jjdelcerro
16 24789 jiyarza
        /**
17
         * Sets the default geometry attribute name
18
         *
19
         * @param name
20
         *                         string containing the default geometry attribute name
21
         */
22 23754 jjdelcerro
        public void setDefaultGeometryAttributeName(String name);
23
24 24789 jiyarza
        /**
25
         * Removes an attribute from this EditableFeatureType, given
26
         * a reference to its descriptor.
27
         *
28
         * @param attribute
29
         *                                 descriptor of the attribute to remove
30
         *
31
         * @return
32
         *                 true if the attribute was removed successfully, false if not.
33
         */
34 23754 jjdelcerro
        public boolean remove(EditableFeatureAttributeDescriptor attribute);
35
36 24789 jiyarza
        /**
37
         * Removes an attribute given its name
38
         *
39
         * @param name
40
         *                         string containing the name of the attribute to be removed
41
         * @return
42
         *
43
         */
44 23754 jjdelcerro
        public Object remove(String name);
45
46 24789 jiyarza
        /**
47
         * Removes an attribute given its index
48
         *
49
         * @param index
50
         *                         position of the attribute to be removed
51
         *
52
         * @return
53
         *
54
         */
55 23754 jjdelcerro
        public Object remove(int index);
56
57 24789 jiyarza
        /**
58
         * Adds an attribute to this EditableFeatureType.
59
         * @param name
60
         *                         string containing the name of the attribute
61
         * @param type
62
         *                         data type of the attribute (one from {@link DataTypes})
63
         *
64
         * @return a new EditableFeatureAttributeDescriptor
65
         */
66 23754 jjdelcerro
        public EditableFeatureAttributeDescriptor add(String name, int type);
67
68 24789 jiyarza
        /**
69
         * Adds an attribute to this EditableFeatureType.
70
         *
71
         * @param name
72
         *                         string containing the name of the attribute
73
         *
74
         * @param type
75
         *                         data type of the attribute (one from {@link DataTypes})
76
         *
77
         * @param size
78
         *                         size of the attribute.
79
         *
80
         * @return a new EditableFeatureAttributeDescriptor
81
         */
82 23754 jjdelcerro
        public EditableFeatureAttributeDescriptor add(String name, int type,
83
                        int size);
84
85 24789 jiyarza
        /**
86
         * Adds a calculated attribute to this EditableFeatureType.
87
         *
88
         * @param name
89
         *                         string containing the name of the attribute
90
         *
91
         * @param type
92
         *                         data type of the attribute (one from {@link DataTypes})
93
         *
94
         * @param evaluator
95
         *                         an evaluator containing the desired expression
96
         *
97
         * @return a new EditableFeatureAttributeDescriptor
98
         */
99 23754 jjdelcerro
        public EditableFeatureAttributeDescriptor add(String name, int type,
100
                        Evaluator evaluator);
101
102 24789 jiyarza
        /**
103
         * Returns the associated FeatureType.
104
         *
105
         * @return the associated FeatureType
106
         */
107 23772 jjdelcerro
        public FeatureType getSource();
108 23754 jjdelcerro
109 24789 jiyarza
        /**
110
         * Returns a copy of the associated FeatureType.
111
         *
112
         * @return associated FeatureType
113
         */
114 23772 jjdelcerro
        public FeatureType getNotEditableCopy();
115 23754 jjdelcerro
116 24789 jiyarza
        /**
117 25040 jiyarza
         * Sets whether this EditableFeatureType has an OID.
118
         * An OID is a unique serializable reference to a feature
119
         * (a primary key of sorts that may or may not be defined
120
         * by the store). If the store does not define this OID then
121
         * it will be generated by the feature reference itself.
122 24789 jiyarza
         *
123 25040 jiyarza
         * Its main use is to provide a way to persist data associated
124
         * to a feature by this OID.
125
         *
126 24789 jiyarza
         * @param hasOID true if it has an OID, or false if not.
127
         */
128 24248 jjdelcerro
        public void setHasOID(boolean hasOID);
129 37297 jpiera
130
        /**
131
         * Sets the default time attribute name
132
     *
133
     * @param name
134
     *          string containing the default time attribute name
135
         */
136
        public void setDefaultTimeAttributeName(String name);
137 23754 jjdelcerro
}