svn-gvsig-desktop / branches / Mobile_Compatible_Hito_1 / libFMap_mobile_shp_driver / src-file / org / gvsig / data / datastores / vectorial / file / shp_util / NewShpFeatureID.java @ 21927
History | View | Annotate | Download (1.03 KB)
1 |
package org.gvsig.data.datastores.vectorial.file.shp_util; |
---|---|
2 |
|
3 |
import java.util.HashMap; |
4 |
|
5 |
import org.gvsig.data.ReadException; |
6 |
import org.gvsig.data.datastores.vectorial.file.shp_jni.JNISHPStore; |
7 |
import org.gvsig.data.vectorial.Feature; |
8 |
import org.gvsig.data.vectorial.FeatureID; |
9 |
import org.gvsig.data.vectorial.FeatureType; |
10 |
|
11 |
public class NewShpFeatureID implements FeatureID { |
12 |
|
13 |
private int featIndex = 0; |
14 |
private IGeometricDataStore store;
|
15 |
|
16 |
public NewShpFeatureID(IGeometricDataStore _store, int findex) { |
17 |
featIndex = findex; |
18 |
store = _store; |
19 |
} |
20 |
|
21 |
public Feature getFeature(FeatureType featureType) throws ReadException { |
22 |
Feature resp =store.getFeatureByID(this, featureType);
|
23 |
return resp;
|
24 |
} |
25 |
|
26 |
public HashMap toHashMap() { |
27 |
HashMap result = new HashMap(); |
28 |
result.put("featureIndex", new Long(featIndex)); |
29 |
return result;
|
30 |
} |
31 |
|
32 |
public int getIndex() { |
33 |
return featIndex;
|
34 |
} |
35 |
|
36 |
public boolean equals(Object obj) { |
37 |
if (obj instanceof NewShpFeatureID) |
38 |
return ((NewShpFeatureID) obj).getIndex() == featIndex;
|
39 |
return false; |
40 |
} |
41 |
|
42 |
|
43 |
} |