Revision 187 org.gvsig.toolbox/trunk/org.gvsig.toolbox/org.gvsig.toolbox.core/src/main/java/es/unex/sextante/dataObjects/IVectorLayer.java
IVectorLayer.java | ||
---|---|---|
4 | 4 |
|
5 | 5 |
import com.vividsolutions.jts.geom.Geometry; |
6 | 6 |
|
7 |
import org.gvsig.tools.exception.BaseException; |
|
8 |
|
|
7 | 9 |
import es.unex.sextante.dataObjects.vectorFilters.IVectorLayerFilter; |
8 | 10 |
|
9 | 11 |
/** |
10 | 12 |
* This is the base interface that all vector layers have to implement to be able to be used by SEXTANTE algorithms. |
11 |
*
|
|
13 |
* |
|
12 | 14 |
* Instead of implementing this class directly, it is recommended to extend {@link AbstractVectorLayer}. |
13 |
*
|
|
15 |
* |
|
14 | 16 |
* @author Victor Olaya. volaya@unex.es |
15 |
*
|
|
17 |
* |
|
16 | 18 |
*/ |
17 | 19 |
public interface IVectorLayer |
18 | 20 |
extends |
... | ... | |
22 | 24 |
public static final int SHAPE_TYPE_LINE = 1; |
23 | 25 |
public static final int SHAPE_TYPE_POLYGON = 2; |
24 | 26 |
public static final int SHAPE_TYPE_MIXED = 3; |
25 |
|
|
27 |
|
|
26 | 28 |
//Types to create a multilayer in gvSIG. Don't use for anything more |
27 | 29 |
public static final int SHAPE_TYPE_MULTIPOINT = 4; |
28 | 30 |
public static final int SHAPE_TYPE_MULTILINE = 5; |
... | ... | |
37 | 39 |
|
38 | 40 |
/** |
39 | 41 |
* Adds a new feature to the layer |
40 |
*
|
|
42 |
* |
|
41 | 43 |
* @param geometry |
42 | 44 |
* the geometry |
43 | 45 |
* @param attributes |
... | ... | |
49 | 51 |
|
50 | 52 |
/** |
51 | 53 |
* Adds a new feature to the layer |
52 |
*
|
|
54 |
* |
|
53 | 55 |
* @param feature |
54 | 56 |
* the feature to add |
55 | 57 |
*/ |
... | ... | |
58 | 60 |
|
59 | 61 |
/** |
60 | 62 |
* Returns an iterator to iterate through the entities of this layer |
61 |
*
|
|
63 |
* |
|
62 | 64 |
* @return an iterator to iterate the layer |
63 | 65 |
*/ |
64 | 66 |
public IFeatureIterator iterator(); |
... | ... | |
66 | 68 |
|
67 | 69 |
/** |
68 | 70 |
* Returns the name of a given field in the attributes table |
69 |
*
|
|
71 |
* |
|
70 | 72 |
* @param index |
71 | 73 |
* the zero-based field index |
72 | 74 |
* @return the name of the selected attribute field |
... | ... | |
76 | 78 |
|
77 | 79 |
/** |
78 | 80 |
* Return a class representing the data type of a given field |
79 |
*
|
|
81 |
* |
|
80 | 82 |
* @param index |
81 | 83 |
* the zero-based field index |
82 | 84 |
* @return the data type of the selected attribute field |
... | ... | |
85 | 87 |
|
86 | 88 |
|
87 | 89 |
/** |
88 |
*
|
|
90 |
* |
|
89 | 91 |
* @return the number of attributes associates to each geometry |
90 | 92 |
*/ |
91 | 93 |
public int getFieldCount(); |
... | ... | |
93 | 95 |
|
94 | 96 |
/** |
95 | 97 |
* Returns an array of classes representing the data types of the fields in the attributes table |
96 |
*
|
|
98 |
* |
|
97 | 99 |
* @return the data types of attribute fields |
98 | 100 |
*/ |
99 | 101 |
public Class[] getFieldTypes(); |
... | ... | |
101 | 103 |
|
102 | 104 |
/** |
103 | 105 |
* Returns the names of the fields in the attributes table |
104 |
*
|
|
106 |
* |
|
105 | 107 |
* @return the names of the attribute fields |
106 | 108 |
*/ |
107 | 109 |
public String[] getFieldNames(); |
... | ... | |
109 | 111 |
|
110 | 112 |
/** |
111 | 113 |
* Returns the number of features in this layer |
112 |
*
|
|
114 |
* |
|
113 | 115 |
* @return the number of features in this layer |
114 | 116 |
*/ |
115 | 117 |
public int getShapesCount(); |
... | ... | |
117 | 119 |
|
118 | 120 |
/** |
119 | 121 |
* Returns the type of geometries in this layer |
120 |
*
|
|
122 |
* |
|
121 | 123 |
* @return the type of geometries in this layer |
122 | 124 |
*/ |
123 | 125 |
public int getShapeType(); |
124 | 126 |
|
127 |
/** |
|
128 |
* Returns the subtype of geometries in this layer |
|
129 |
* |
|
130 |
* @return the subtype of geometries in this layer |
|
131 |
* @throws ReadException |
|
132 |
*/ |
|
133 |
public int getSubType() throws BaseException; |
|
125 | 134 |
|
135 |
|
|
126 | 136 |
/** |
127 | 137 |
* Returns the index of a field from its name. Returns -1 if there is not a field with that name. |
128 |
*
|
|
138 |
* |
|
129 | 139 |
* @param fieldName |
130 | 140 |
* the name of the field |
131 | 141 |
* @return the index of the given field |
... | ... | |
136 | 146 |
/** |
137 | 147 |
* Adds a new filter to this layer. When iterating the features in this layer, only those that pass the filter will be |
138 | 148 |
* returned. |
139 |
*
|
|
149 |
* |
|
140 | 150 |
* @param filter |
141 | 151 |
* the filter to add |
142 | 152 |
*/ |
... | ... | |
151 | 161 |
|
152 | 162 |
/** |
153 | 163 |
* Returns a list of all the filters currently added to this layer |
154 |
*
|
|
164 |
* |
|
155 | 165 |
* @return a list of all the filters currently added to this layer |
156 | 166 |
*/ |
157 | 167 |
public List<IVectorLayerFilter> getFilters(); |
... | ... | |
160 | 170 |
/** |
161 | 171 |
* Returns true if the layer can be edited. This includes editing while the layer is being read, so it can be overwritten by |
162 | 172 |
* algorithms that allow overwriting of input layers |
163 |
*
|
|
173 |
* |
|
164 | 174 |
* @return true if the layer can be edited |
165 | 175 |
*/ |
166 | 176 |
public boolean canBeEdited(); |
167 | 177 |
|
168 |
|
|
169 | 178 |
} |
Also available in: Unified diff