svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.api / src / main / java / org / gvsig / fmap / dal / feature / FeatureCache.java @ 40435
History | View | Annotate | Download (2.59 KB)
1 | 40435 | jjdelcerro | /* gvSIG. Geographic Information System of the Valencian Government
|
---|---|---|---|
2 | *
|
||
3 | * Copyright (C) 2007-2008 Infrastructures and Transports Department
|
||
4 | * of the Valencian Government (CIT)
|
||
5 | *
|
||
6 | * This program is free software; you can redistribute it and/or
|
||
7 | * modify it under the terms of the GNU General Public License
|
||
8 | * as published by the Free Software Foundation; either version 2
|
||
9 | * of the License, or (at your option) any later version.
|
||
10 | *
|
||
11 | * This program is distributed in the hope that it will be useful,
|
||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
14 | * GNU General Public License for more details.
|
||
15 | *
|
||
16 | * You should have received a copy of the GNU General Public License
|
||
17 | * along with this program; if not, write to the Free Software
|
||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||
19 | * MA 02110-1301, USA.
|
||
20 | *
|
||
21 | */
|
||
22 | |||
23 | /*
|
||
24 | * AUTHORS (In addition to CIT):
|
||
25 | * 2009 {Iver T.I.} {Task}
|
||
26 | */
|
||
27 | |||
28 | package org.gvsig.fmap.dal.feature; |
||
29 | |||
30 | import org.gvsig.fmap.dal.exception.DataException; |
||
31 | import org.gvsig.fmap.geom.primitive.Envelope; |
||
32 | |||
33 | /**
|
||
34 | * This class represents a vectorial cache that is used to save and retrieve
|
||
35 | * {@link FeatureSet}s. First time that a {@link FeatureStore} have to retrieve
|
||
36 | * data from a {@link FeatureStoreProvider} can save the {@link FeatureSet} in
|
||
37 | * the cache with its envelope. Next time that the store has to access to a envelope
|
||
38 | * contained in the previous envelope can retrieve the features directly
|
||
39 | * from the cache and it is not necessary to retrieve data from the provider.
|
||
40 | *
|
||
41 | * The cache supports different scales and creates
|
||
42 | *
|
||
43 | * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
|
||
44 | */
|
||
45 | public interface FeatureCache { |
||
46 | |||
47 | /**
|
||
48 | * Delete all the features for a concrete scale.
|
||
49 | * @param scale
|
||
50 | * The scale.
|
||
51 | * @throws DataException
|
||
52 | */
|
||
53 | public void delete(double scale) throws DataException; |
||
54 | |||
55 | /**
|
||
56 | * Delete all the features for all the scales in the cache system.
|
||
57 | * @throws DataException
|
||
58 | */
|
||
59 | public void deleteAll() throws DataException; |
||
60 | |||
61 | /**
|
||
62 | * Add a set of features contained in a envelope for a concrete scale.
|
||
63 | * @param featureSet
|
||
64 | * The feature set retrieved from the server.
|
||
65 | * @throws DataException
|
||
66 | */
|
||
67 | public void addFeatures(FeatureSet featureSet, FeatureStore featureStore) throws DataException; |
||
68 | |||
69 | /**
|
||
70 | * Return a feature set form a concrete envelope and a scale.
|
||
71 | * @param envelope
|
||
72 | * The envelope.
|
||
73 | * @param scale
|
||
74 | * The scale.
|
||
75 | * @return
|
||
76 | * A feature set contained in the evelope.
|
||
77 | * @throws DataException
|
||
78 | */
|
||
79 | public FeatureSet getFeatureSet(Envelope envelope, double scale) throws DataException; |
||
80 | } |