svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.impl / src / main / java / org / gvsig / fmap / dal / feature / impl / featureset / FastFilteredIterator.java @ 40435
History | View | Annotate | Download (1.16 KB)
1 | 40435 | jjdelcerro | package org.gvsig.fmap.dal.feature.impl.featureset; |
---|---|---|---|
2 | |||
3 | import org.gvsig.fmap.dal.exception.DataException; |
||
4 | import org.gvsig.fmap.dal.feature.impl.DefaultFeature; |
||
5 | import org.gvsig.fmap.dal.feature.spi.FeatureProvider; |
||
6 | import org.gvsig.tools.exception.BaseException; |
||
7 | |||
8 | public class FastFilteredIterator extends FilteredIterator { |
||
9 | |||
10 | DefaultFeature myFeature; |
||
11 | |||
12 | FastFilteredIterator(DefaultFeatureSet featureSet, long index)
|
||
13 | throws DataException {
|
||
14 | super(featureSet);
|
||
15 | initializeFeature(); |
||
16 | |||
17 | this.iterator = featureSet.provider.fastIterator();
|
||
18 | if (index > 0) { |
||
19 | this.skypto(index);
|
||
20 | } |
||
21 | } |
||
22 | |||
23 | protected DefaultFeature createFeature(FeatureProvider fData)
|
||
24 | throws DataException {
|
||
25 | fData.setNew(false);
|
||
26 | this.myFeature.setData(fData);
|
||
27 | |||
28 | if (this.fset.transform.isEmpty()) { |
||
29 | return myFeature;
|
||
30 | } else {
|
||
31 | return (DefaultFeature) this.fset.transform.applyTransform( |
||
32 | myFeature, fset.getDefaultFeatureType()); |
||
33 | } |
||
34 | } |
||
35 | |||
36 | protected void initializeFeature() { |
||
37 | myFeature = new DefaultFeature(fset.store);
|
||
38 | } |
||
39 | |||
40 | public void remove() { |
||
41 | super.remove();
|
||
42 | this.initializeFeature();
|
||
43 | } |
||
44 | |||
45 | protected void doDispose() throws BaseException { |
||
46 | super.doDispose();
|
||
47 | myFeature = null;
|
||
48 | } |
||
49 | |||
50 | } |