Revision 24141 branches/v2_0_0_prep/libraries/libFMap_data/src/org/gvsig/fmap/data/feature/impl/DefaultFeature.java
DefaultFeature.java | ||
---|---|---|
25 | 25 |
protected FeatureData data; |
26 | 26 |
private WeakReference storeRef; |
27 | 27 |
|
28 |
private class NullFeatureReference implements FeatureReference { |
|
29 |
|
|
30 |
private Feature feature; |
|
31 |
|
|
32 |
public NullFeatureReference(Feature feature) { |
|
33 |
this.feature = feature; |
|
34 |
} |
|
35 |
|
|
36 |
public Feature getFeature() throws DataException { |
|
37 |
return feature; |
|
38 |
} |
|
39 |
|
|
40 |
public Feature getFeature(FeatureType featureType) throws DataException { |
|
41 |
// FIXME: Not yet implemented |
|
42 |
return feature; |
|
43 |
} |
|
44 |
|
|
45 |
public Object getId() { |
|
46 |
return null; |
|
47 |
} |
|
48 |
|
|
49 |
} |
|
50 |
|
|
51 |
|
|
52 | 28 |
/* |
53 | 29 |
* Usar con mucha precaucion o mejor no usar. Lo precisa el |
54 | 30 |
* DefaultFeatureSet en la ordenacion. |
... | ... | |
60 | 36 |
public DefaultFeature(FeatureStore store, FeatureData data) { |
61 | 37 |
this.data = data; |
62 | 38 |
if (this.data.getReference() == null) { |
63 |
this.data.setReference(new NullFeatureReference(this));
|
|
39 |
throw new IllegalArgumentException("data");
|
|
64 | 40 |
} |
65 | 41 |
this.storeRef = new WeakReference(store); |
66 | 42 |
} |
67 | 43 |
|
68 | 44 |
DefaultFeature(DefaultFeature feature) { |
69 | 45 |
this.data = feature.data.getCopy(); |
70 |
this.data.setReference(new NullFeatureReference(this)); |
|
46 |
//this.data.setReference(new NullFeatureReference(this));
|
|
71 | 47 |
this.storeRef = feature.storeRef; |
72 | 48 |
} |
73 | 49 |
|
Also available in: Unified diff