Revision 24202 branches/v2_0_0_prep/libraries/libFMap_data/src/org/gvsig/fmap/data/feature/impl/DefaultFeatureIndex.java
DefaultFeatureIndex.java | ||
---|---|---|
40 | 40 |
import org.gvsig.fmap.data.feature.FeatureReference; |
41 | 41 |
import org.gvsig.fmap.data.feature.FeatureSet; |
42 | 42 |
import org.gvsig.fmap.data.feature.FeatureType; |
43 |
import org.gvsig.fmap.data.feature.exceptions.DataIndexException;
|
|
43 |
import org.gvsig.fmap.data.feature.exceptions.FeatureIndexException;
|
|
44 | 44 |
import org.gvsig.fmap.data.feature.spi.DefaultLongList; |
45 | 45 |
import org.gvsig.fmap.data.feature.spi.FeatureSetProvider; |
46 | 46 |
import org.gvsig.fmap.data.feature.spi.FeatureStoreProviderServices; |
47 | 47 |
import org.gvsig.fmap.data.feature.spi.index.FeatureIndexProvider; |
48 | 48 |
import org.gvsig.fmap.data.feature.spi.index.FeatureIndexProviderServices; |
49 |
import org.gvsig.tools.exception.NotYetImplemented; |
|
50 | 49 |
|
51 | 50 |
/** |
52 | 51 |
* Default feature index provider services. |
... | ... | |
122 | 121 |
/** |
123 | 122 |
* Fills this index with all the data in its FeatureStore |
124 | 123 |
*/ |
125 |
public final void fill() throws DataIndexException {
|
|
124 |
public final void fill() throws FeatureIndexException {
|
|
126 | 125 |
try { |
127 | 126 |
insert(getFeatureStore().getFeatureSet()); |
128 | 127 |
} catch (DataException e) { |
129 |
throw new DataIndexException(e);
|
|
128 |
throw new FeatureIndexException(e);
|
|
130 | 129 |
} |
131 | 130 |
} |
132 | 131 |
|
... | ... | |
149 | 148 |
} |
150 | 149 |
|
151 | 150 |
public FeatureSetProvider getMatchFeatureSet(Object value) |
152 |
throws DataIndexException {
|
|
151 |
throws FeatureIndexException {
|
|
153 | 152 |
return new IndexFeatureSet(this, new DefaultLongList(indexProvider |
154 | 153 |
.match(value))); |
155 | 154 |
} |
156 | 155 |
|
157 | 156 |
public FeatureSetProvider getRangeFeatureSet(Object value1, Object value2) |
158 |
throws DataIndexException {
|
|
157 |
throws FeatureIndexException {
|
|
159 | 158 |
return new IndexFeatureSet(this, new DefaultLongList(indexProvider |
160 |
.match(value1, value2)));
|
|
159 |
.range(value1, value2)));
|
|
161 | 160 |
} |
162 | 161 |
|
163 | 162 |
public FeatureSetProvider getNearestFeatureSet(int count, Object value) |
164 |
throws DataIndexException {
|
|
163 |
throws FeatureIndexException {
|
|
165 | 164 |
return new IndexFeatureSet(this, new DefaultLongList(indexProvider |
166 | 165 |
.nearest(count, value))); |
167 | 166 |
} |
168 | 167 |
|
169 |
public FeatureSetProvider getNearestFeatureSet(int count, int tolerance, |
|
170 |
Object value) throws DataIndexException { |
|
171 |
// TODO Ver si indice soporta tolerancia / Implementar con tolerancia |
|
168 |
public FeatureSetProvider getNearestFeatureSet(int count, Object value, double tolerance) throws FeatureIndexException { |
|
172 | 169 |
return new IndexFeatureSet(this, new DefaultLongList(indexProvider |
173 |
.nearest(count, value))); |
|
170 |
.nearest(count, value, tolerance)));
|
|
174 | 171 |
} |
175 | 172 |
|
176 | 173 |
public void initialize() throws InitializeException { |
... | ... | |
186 | 183 |
indexProvider.delete(feat.get(this.attributeName), feat.getReference()); |
187 | 184 |
} |
188 | 185 |
|
189 |
public void delete(FeatureSet data) throws DataIndexException {
|
|
186 |
public void delete(FeatureSet data) throws FeatureIndexException {
|
|
190 | 187 |
try { |
191 | 188 |
Iterator it = data.iterator(); |
192 | 189 |
while (it.hasNext()) { |
... | ... | |
194 | 191 |
delete(feat); |
195 | 192 |
} |
196 | 193 |
} catch (DataException e) { |
197 |
throw new DataIndexException(e);
|
|
194 |
throw new FeatureIndexException(e);
|
|
198 | 195 |
} |
199 | 196 |
} |
200 | 197 |
|
201 |
public String[] getAttributeNames() {
|
|
198 |
public List getAttributeNames() {
|
|
202 | 199 |
// TODO Auto-generated method stub |
203 | 200 |
return null; |
204 | 201 |
} |
... | ... | |
223 | 220 |
return null; |
224 | 221 |
} |
225 | 222 |
|
223 |
public FeatureIndexProvider getFeatureIndexProvider() { |
|
224 |
return this.indexProvider; |
|
225 |
} |
|
226 | 226 |
|
227 | 227 |
} |
228 | 228 |
|
Also available in: Unified diff