root / branches / v2_0_0_prep / libraries / libFMap_dal / src / org / gvsig / fmap / dal / feature / spi / memory / MemoryFeatureSet.java @ 27672
History | View | Annotate | Download (1.37 KB)
1 |
package org.gvsig.fmap.dal.feature.spi.memory; |
---|---|
2 |
|
3 |
import org.gvsig.fmap.dal.exception.DataException; |
4 |
import org.gvsig.fmap.dal.feature.DisposableIterator; |
5 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
6 |
import org.gvsig.fmap.dal.feature.FeatureType; |
7 |
import org.gvsig.fmap.dal.feature.spi.FeatureSetProvider; |
8 |
|
9 |
public class MemoryFeatureSet implements FeatureSetProvider { |
10 |
|
11 |
AbstractMemoryStoreProvider store; |
12 |
|
13 |
public MemoryFeatureSet(AbstractMemoryStoreProvider store,
|
14 |
FeatureQuery query, FeatureType featureType) { |
15 |
this.store = store;
|
16 |
/*
|
17 |
* Nota: Como no sabe filtrar ni ordenar ignora el query.
|
18 |
*/
|
19 |
} |
20 |
|
21 |
public boolean canFilter() { |
22 |
return false; |
23 |
} |
24 |
|
25 |
public boolean canOrder() { |
26 |
return false; |
27 |
} |
28 |
|
29 |
public boolean canIterateFromIndex() { |
30 |
return true; |
31 |
} |
32 |
|
33 |
public DisposableIterator fastIterator(long index) throws DataException { |
34 |
return store.dataIterator(index);
|
35 |
} |
36 |
|
37 |
public DisposableIterator fastIterator() throws DataException { |
38 |
return store.dataIterator();
|
39 |
} |
40 |
|
41 |
public long getSize() throws DataException { |
42 |
return store.getDataSize();
|
43 |
} |
44 |
|
45 |
public boolean isEmpty() throws DataException { |
46 |
return store.getDataSize() < 1; |
47 |
} |
48 |
|
49 |
public DisposableIterator iterator() throws DataException { |
50 |
return store.dataIterator();
|
51 |
} |
52 |
|
53 |
public DisposableIterator iterator(long index) throws DataException { |
54 |
return store.dataIterator(index);
|
55 |
} |
56 |
|
57 |
public void dispose() { |
58 |
store = null;
|
59 |
} |
60 |
} |