Revision 46505 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/FastDefaultIterator.java
FastDefaultIterator.java | ||
---|---|---|
26 | 26 |
import org.gvsig.fmap.dal.exception.DataException; |
27 | 27 |
import org.gvsig.fmap.dal.feature.impl.DefaultFeature; |
28 | 28 |
import org.gvsig.fmap.dal.feature.spi.FeatureProvider; |
29 |
import org.gvsig.tools.dispose.DisposeUtils; |
|
29 | 30 |
import org.gvsig.tools.exception.BaseException; |
30 | 31 |
|
31 | 32 |
public class FastDefaultIterator extends DefaultIterator { |
... | ... | |
35 | 36 |
public FastDefaultIterator(DefaultFeatureSet featureSet, long index, long elements) |
36 | 37 |
throws DataException { |
37 | 38 |
super(featureSet); |
38 |
this.initializeFeature(); |
|
39 |
if (index > 0 || elements>0 ) { |
|
40 |
if (featureSet.provider.canIterateFromIndex()) { |
|
41 |
try { |
|
42 |
this.iterator = featureSet.provider.fastIterator(index,elements); |
|
43 |
} catch (UnsupportedOperationException e) { |
|
44 |
this.iterator = featureSet.provider.fastIterator(); |
|
45 |
skypto(index); |
|
46 |
} |
|
47 |
} else { |
|
48 |
this.iterator = featureSet.provider.fastIterator(); |
|
49 |
skypto(index); |
|
50 |
} |
|
51 |
} else { |
|
52 |
this.iterator = featureSet.provider.fastIterator(); |
|
53 |
} |
|
39 |
try{ |
|
40 |
this.initializeFeature(); |
|
41 |
if (index > 0 || elements>0 ) { |
|
42 |
if (featureSet.provider.canIterateFromIndex()) { |
|
43 |
try { |
|
44 |
this.iterator = featureSet.provider.fastIterator(index,elements); |
|
45 |
} catch (UnsupportedOperationException e) { |
|
46 |
this.iterator = featureSet.provider.fastIterator(); |
|
47 |
skypto(index); |
|
48 |
} |
|
49 |
} else { |
|
50 |
this.iterator = featureSet.provider.fastIterator(); |
|
51 |
skypto(index); |
|
52 |
} |
|
53 |
} else { |
|
54 |
this.iterator = featureSet.provider.fastIterator(); |
|
55 |
} |
|
56 |
} catch (Throwable t) { |
|
57 |
DisposeUtils.dispose(this.fset); |
|
58 |
DisposeUtils.dispose(this); |
|
59 |
throw t; |
|
60 |
} |
|
54 | 61 |
|
55 | 62 |
} |
56 | 63 |
|
Also available in: Unified diff