Revision 35115 branches/dal_time_support/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/FeatureSet.java
FeatureSet.java | ||
---|---|---|
7 | 7 |
import org.gvsig.tools.dispose.DisposableIterator; |
8 | 8 |
import org.gvsig.tools.dynobject.DynObject; |
9 | 9 |
import org.gvsig.tools.dynobject.DynObjectSet; |
10 |
import org.gvsig.tools.exception.BaseException; |
|
10 | 11 |
import org.gvsig.tools.visitor.IndexedVisitable; |
12 |
import org.gvsig.tools.visitor.Visitor; |
|
11 | 13 |
|
12 | 14 |
/** |
13 | 15 |
* A FeatureSet represents a set of {@link Feature}(s). These sets of features |
... | ... | |
63 | 65 |
*/ |
64 | 66 |
public long getSize() throws DataException; |
65 | 67 |
|
66 |
/** |
|
67 |
* Returns an iterator over the elements in this collection, in the order |
|
68 |
* (if any) defined when the collection was obtained. |
|
69 |
* |
|
70 |
* The iterator starts at the specified position in this collection. The |
|
71 |
* specified index indicates the first element that would be returned by an |
|
72 |
* initial call to the <tt>next</tt> method. An initial call to the |
|
73 |
* <tt>previous</tt> method would return the element with the specified |
|
74 |
* index minus one. |
|
75 |
* |
|
76 |
* <p> |
|
77 |
* <em> |
|
78 |
* <strong>NOTE:</strong> if you use this method to get the iterator, you |
|
79 |
* must get sure the iterator is disposed (@see |
|
80 |
* {@link DisposableIterator#dispose()}) in any case, even if an error occurs |
|
81 |
* while getting the data. It is recommended to use the <code>accept</code> |
|
82 |
* methods instead, which handle everything for you. |
|
83 |
* Take into account the accept methods may use a fast iterator to |
|
84 |
* get the features. |
|
85 |
* </em> |
|
86 |
* </p> |
|
87 |
* |
|
88 |
* @see #accept(org.gvsig.tools.visitor.Visitor) |
|
89 |
* @see #accept(org.gvsig.tools.visitor.Visitor, long) |
|
90 |
* |
|
91 |
* @param index |
|
92 |
* index of first element to be returned from the iterator (by a |
|
93 |
* call to the <tt>next</tt> method). |
|
94 |
* @return an iterator of the elements in this collection (in proper |
|
95 |
* sequence), starting at the specified position in the collection. |
|
96 |
* @throws DataException |
|
97 |
* if the index is out of range (index < 0 || index > |
|
98 |
* size()). |
|
99 |
*/ |
|
68 |
/** |
|
69 |
* Returns an iterator over the elements in this collection, in the order |
|
70 |
* (if any) defined when the collection was obtained. |
|
71 |
* |
|
72 |
* The iterator starts at the specified position in this collection. The |
|
73 |
* specified index indicates the first element that would be returned by an |
|
74 |
* initial call to the <tt>next</tt> method. An initial call to the |
|
75 |
* <tt>previous</tt> method would return the element with the specified |
|
76 |
* index minus one. |
|
77 |
* |
|
78 |
* <p> |
|
79 |
* <em> |
|
80 |
* <strong>NOTE:</strong> if you use this method to get the iterator, you |
|
81 |
* must get sure the iterator is disposed (@see |
|
82 |
* {@link DisposableIterator#dispose()}) in any case, even if an error occurs |
|
83 |
* while getting the data. It is recommended to use the <code>accept</code> |
|
84 |
* methods instead, which handle everything for you. |
|
85 |
* Take into account the accept methods may use a fast iterator to |
|
86 |
* get the features. |
|
87 |
* </em> |
|
88 |
* </p> |
|
89 |
* |
|
90 |
* @see #accept(org.gvsig.tools.visitor.Visitor) |
|
91 |
* @see #accept(org.gvsig.tools.visitor.Visitor, long) |
|
92 |
* @see #fastIterator() |
|
93 |
* @see #fastIterator(long) |
|
94 |
* |
|
95 |
* @param index |
|
96 |
* index of first element to be returned from the iterator (by a |
|
97 |
* call to the <tt>next</tt> method). |
|
98 |
* @return an iterator of the elements in this collection (in proper |
|
99 |
* sequence), starting at the specified position in the collection. |
|
100 |
* @throws DataException |
|
101 |
* if the index is out of range (index < 0 || index > |
|
102 |
* size()). |
|
103 |
* @deprecated use {@link #fastIterator(long)} instead |
|
104 |
*/ |
|
100 | 105 |
DisposableIterator iterator(long index) throws DataException; |
101 | 106 |
|
102 |
/** |
|
103 |
* Returns an iterator over the elements in this collection, in the order |
|
104 |
* (if any) defined when the collection was obtained. |
|
105 |
* |
|
106 |
* <p> |
|
107 |
* <em> |
|
108 |
* <strong>NOTE:</strong> if you use this method to get the iterator, you |
|
109 |
* must get sure the iterator is disposed (@see |
|
110 |
* {@link DisposableIterator#dispose()}) in any case, even if an error occurs |
|
111 |
* while getting the data. It is recommended to use the <code>accept</code> |
|
112 |
* methods instead, which handle everything for you. |
|
113 |
* Take into account the accept methods may use a fast iterator to |
|
114 |
* get the features. |
|
115 |
* </em> |
|
116 |
* </p> |
|
117 |
* |
|
118 |
* @see #accept(org.gvsig.tools.visitor.Visitor) |
|
119 |
* @see #accept(org.gvsig.tools.visitor.Visitor, long) |
|
120 |
* |
|
121 |
* @return an iterator of the elements in this collection (in proper |
|
122 |
* sequence). |
|
123 |
* |
|
124 |
* @throws DataException |
|
125 |
*/ |
|
107 |
/** |
|
108 |
* Returns an iterator over the elements in this collection, in the order |
|
109 |
* (if any) defined when the collection was obtained. |
|
110 |
* |
|
111 |
* <p> |
|
112 |
* <em> |
|
113 |
* <strong>NOTE:</strong> if you use this method to get the iterator, you |
|
114 |
* must get sure the iterator is disposed (@see |
|
115 |
* {@link DisposableIterator#dispose()}) in any case, even if an error occurs |
|
116 |
* while getting the data. It is recommended to use the <code>accept</code> |
|
117 |
* methods instead, which handle everything for you. |
|
118 |
* Take into account the accept methods may use a fast iterator to |
|
119 |
* get the features. |
|
120 |
* </em> |
|
121 |
* </p> |
|
122 |
* |
|
123 |
* @see #accept(org.gvsig.tools.visitor.Visitor) |
|
124 |
* @see #accept(org.gvsig.tools.visitor.Visitor, long) |
|
125 |
* @see #fastIterator() |
|
126 |
* @see #fastIterator(long) |
|
127 |
* |
|
128 |
* @return an iterator of the elements in this collection (in proper |
|
129 |
* sequence). |
|
130 |
* |
|
131 |
* @throws DataException |
|
132 |
* if there is an error getting the iterator |
|
133 |
* |
|
134 |
* @deprecated use {@link #fastIterator()} instead |
|
135 |
*/ |
|
126 | 136 |
DisposableIterator iterator() throws DataException; |
127 | 137 |
|
128 |
/** |
|
129 |
* Returns a fast iterator over this set. |
|
130 |
* |
|
131 |
* <p> |
|
132 |
* <em> |
|
133 |
* <strong>NOTE:</strong> if you use this method to get the iterator, you |
|
134 |
* must get sure the iterator is disposed (@see |
|
135 |
* {@link DisposableIterator#dispose()}) in any case, even if an error occurs |
|
136 |
* while getting the data. It is recommended to use the <code>accept</code> |
|
137 |
* methods instead, which handle everything for you. |
|
138 |
* Take into account the accept methods may use a fast iterator to |
|
139 |
* get the features. |
|
140 |
* </em> |
|
141 |
* </p> |
|
142 |
* |
|
143 |
* @see #accept(org.gvsig.tools.visitor.Visitor) |
|
144 |
* @see #accept(org.gvsig.tools.visitor.Visitor, long) |
|
145 |
* |
|
146 |
* @return an iterator over this set. |
|
147 |
* |
|
148 |
* @throws DataException |
|
149 |
*/ |
|
138 |
/** |
|
139 |
* Returns a fast iterator over this set. |
|
140 |
* <p> |
|
141 |
* Fast in this case means that each of the elements returned may be a |
|
142 |
* reused or pooled object instance, so don't use it to be stored in any |
|
143 |
* way. |
|
144 |
* </p> |
|
145 |
* <p> |
|
146 |
* If you need to store one of the {@link Feature} of the iterator, use the |
|
147 |
* {@link Feature#getCopy()} to create a clone of the object. |
|
148 |
* </p> |
|
149 |
* |
|
150 |
* <p> |
|
151 |
* <em> |
|
152 |
* <strong>NOTE:</strong> if you use this method to get the iterator, you |
|
153 |
* must get sure the iterator is disposed (@see |
|
154 |
* {@link DisposableIterator#dispose()}) in any case, even if an error occurs |
|
155 |
* while getting the data. It is recommended to use the <code>accept</code> |
|
156 |
* methods instead, which handle everything for you. |
|
157 |
* Take into account the accept methods may use a fast iterator to |
|
158 |
* get the features. |
|
159 |
* </em> |
|
160 |
* </p> |
|
161 |
* |
|
162 |
* @see #accept(org.gvsig.tools.visitor.Visitor) |
|
163 |
* @see #accept(org.gvsig.tools.visitor.Visitor, long) |
|
164 |
* |
|
165 |
* @return an iterator over this set. |
|
166 |
* |
|
167 |
* @throws DataException |
|
168 |
*/ |
|
150 | 169 |
public DisposableIterator fastIterator() throws DataException; |
151 | 170 |
|
152 |
/** |
|
153 |
* Returns a fast iterator over this set, starting from the given index. |
|
154 |
* |
|
155 |
* <p> |
|
156 |
* <em> |
|
157 |
* <strong>NOTE:</strong> if you use this method to get the iterator, you |
|
158 |
* must get sure the iterator is disposed (@see |
|
159 |
* {@link DisposableIterator#dispose()}) in any case, even if an error occurs |
|
160 |
* while getting the data. It is recommended to use the <code>accept</code> |
|
161 |
* methods instead, which handle everything for you. |
|
162 |
* Take into account the accept methods may use a fast iterator to |
|
163 |
* get the features. |
|
164 |
* </em> |
|
165 |
* </p> |
|
166 |
* |
|
167 |
* @see #accept(org.gvsig.tools.visitor.Visitor) |
|
168 |
* @see #accept(org.gvsig.tools.visitor.Visitor, long) |
|
169 |
* |
|
170 |
* @param index |
|
171 |
* position in which the iterator is initially located. |
|
172 |
* |
|
173 |
* @return an iterator initially located at the position indicated by the |
|
174 |
* given index |
|
175 |
* |
|
176 |
* @throws DataException |
|
177 |
*/ |
|
171 |
/** |
|
172 |
* Returns a fast iterator over this set, starting from the given index. |
|
173 |
* <p> |
|
174 |
* Fast in this case means that each of the elements returned may be a |
|
175 |
* reused or pooled object instance, so don't use it to be stored in any |
|
176 |
* way. |
|
177 |
* </p> |
|
178 |
* <p> |
|
179 |
* If you need to store one of the {@link Feature} of the iterator, use the |
|
180 |
* {@link Feature#getCopy()} to create a clone of the object. |
|
181 |
* </p> |
|
182 |
* |
|
183 |
* <p> |
|
184 |
* <em> |
|
185 |
* <strong>NOTE:</strong> if you use this method to get the iterator, you |
|
186 |
* must get sure the iterator is disposed (@see |
|
187 |
* {@link DisposableIterator#dispose()}) in any case, even if an error occurs |
|
188 |
* while getting the data. It is recommended to use the <code>accept</code> |
|
189 |
* methods instead, which handle everything for you. |
|
190 |
* Take into account the accept methods may use a fast iterator to |
|
191 |
* get the features. |
|
192 |
* </em> |
|
193 |
* </p> |
|
194 |
* |
|
195 |
* @see #accept(org.gvsig.tools.visitor.Visitor) |
|
196 |
* @see #accept(org.gvsig.tools.visitor.Visitor, long) |
|
197 |
* |
|
198 |
* @param index |
|
199 |
* position in which the iterator is initially located. |
|
200 |
* |
|
201 |
* @return an iterator initially located at the position indicated by the |
|
202 |
* given index |
|
203 |
* |
|
204 |
* @throws DataException |
|
205 |
*/ |
|
178 | 206 |
public DisposableIterator fastIterator(long index) throws DataException; |
179 | 207 |
|
180 | 208 |
/** |
... | ... | |
250 | 278 |
*/ |
251 | 279 |
public DynObjectSet getDynObjectSet(boolean fast); |
252 | 280 |
|
281 |
/** |
|
282 |
* Provides each value of this Store to the provided {@link Visitor}, |
|
283 |
* beginning from the provided index position. |
|
284 |
* The values received through the {@link Visitor#visit(Object)} method |
|
285 |
* may be transient, reused or externally modifiable, so they can't |
|
286 |
* be used to be stored in any external form out of the visit method. |
|
287 |
* |
|
288 |
* If you need to store any of the values out of the |
|
289 |
* {@link Visitor#visit(Object)} method execution, create a copy or clone |
|
290 |
* the received value in order to be stored. |
|
291 |
* |
|
292 |
* @param visitor |
|
293 |
* the visitor to apply to each value. |
|
294 |
* @param firstValueIndex |
|
295 |
* index of first element to be visited by the {@link Visitor} |
|
296 |
* @exception BaseException |
|
297 |
* if there is an error while performing the visit |
|
298 |
*/ |
|
299 |
void accept(Visitor visitor, long firstValueIndex) throws BaseException; |
|
253 | 300 |
} |
Also available in: Unified diff