Revision 19403 trunk/libraries/libDataSourceBaseDrivers/src/org/gvsig/data/datastores/vectorial/driver/dbf/DBFFeatureCollection.java
DBFFeatureCollection.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import java.util.ArrayList; |
4 | 4 |
import java.util.Collection; |
5 |
import java.util.ConcurrentModificationException; |
|
5 | 6 |
import java.util.Iterator; |
6 | 7 |
|
7 | 8 |
import org.gvsig.data.ComplexObservable; |
8 | 9 |
import org.gvsig.data.IObservable; |
9 |
import org.gvsig.data.IObserver; |
|
10 | 10 |
import org.gvsig.data.vectorial.IFeature; |
11 | 11 |
import org.gvsig.data.vectorial.IFeatureAttributeDescriptor; |
12 | 12 |
import org.gvsig.data.vectorial.IFeatureCollection; |
... | ... | |
16 | 16 |
import org.nfunk.jep.JEP; |
17 | 17 |
import org.nfunk.jep.Node; |
18 | 18 |
|
19 |
public class DBFFeatureCollection implements IFeatureCollection, IObserver {
|
|
19 |
public class DBFFeatureCollection implements IFeatureCollection { |
|
20 | 20 |
protected ComplexObservable observable = new ComplexObservable(); |
21 | 21 |
protected ArrayList featureIDs=new ArrayList();//<IFeatureID> |
22 | 22 |
protected IFeatureType featureType; |
... | ... | |
26 | 26 |
private JEP parser = null; |
27 | 27 |
protected FeatureManager featureManager; |
28 | 28 |
protected long driverFeatureCount=0; |
29 |
protected boolean modified=false; |
|
29 | 30 |
|
30 | 31 |
public DBFFeatureCollection(FeatureManager fm,DBFDriver driver,IFeatureType type, String filter, String order) { |
31 | 32 |
this.featureManager=fm; |
... | ... | |
155 | 156 |
} |
156 | 157 |
|
157 | 158 |
public void update(IObservable obsevable, Object notification) { |
158 |
// TODO Auto-generated method stub
|
|
159 |
modified=true;
|
|
159 | 160 |
|
160 | 161 |
} |
161 | 162 |
private class DBFIterator implements Iterator{ |
... | ... | |
194 | 195 |
public Object next() { |
195 | 196 |
// IFeature feature=((IFeatureID)featureIDs.get(position)).getFeature(featureType); |
196 | 197 |
// position++; |
198 |
if (modified) |
|
199 |
throw new ConcurrentModificationException("FeatureCollection modified"); |
|
197 | 200 |
return feature; |
198 | 201 |
} |
199 | 202 |
|
Also available in: Unified diff