Statistics
| Revision:

root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / layers / ReadableVectorial.java @ 10627

History | View | Annotate | Download (4.84 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package com.iver.cit.gvsig.fmap.layers;
42

    
43
import java.awt.geom.Rectangle2D;
44

    
45
import com.hardcode.gdbms.driver.exceptions.InitializeDriverException;
46
import com.hardcode.gdbms.driver.exceptions.OpenDriverException;
47
import com.hardcode.gdbms.driver.exceptions.ReadDriverException;
48
import com.iver.cit.gvsig.exceptions.expansionfile.ExpansionFileReadException;
49
import com.iver.cit.gvsig.fmap.core.IFeature;
50
import com.iver.cit.gvsig.fmap.core.IGeometry;
51
import com.iver.cit.gvsig.fmap.drivers.DriverAttributes;
52
import com.iver.cit.gvsig.fmap.drivers.VectorialDriver;
53

    
54

    
55
/**
56
 * Interfaz usada internamente para acceder a fuentes de datos vectoriales en
57
 * modo lectura
58
 */
59
public interface ReadableVectorial {
60
        /**
61
         * Indica que se va a comenzar a hacer una serie de operaciones sobre el
62
         * origen de datos con la finalidad de que dicho origen de datos se
63
         * prepare (abra el fichero, comience una transacci?n, conecte al
64
         * servidor, ...). Abre el fichero de ?ndices en caso de que exista.
65
         * @throws ReadDriverException TODO
66
         * @throws OpenDriverException
67
         * @throws InitializeDriverException
68
         */
69
        void start() throws ReadDriverException, InitializeDriverException;
70

    
71
        /**
72
         * Hace que se cierre el soporte f?sico de la capa. Cierra el fichero de
73
         * ?ndices en caso de que exista.
74
         * @throws ReadDriverException TODO
75
         */
76
        void stop() throws ReadDriverException;
77

    
78
        /**
79
         * Devuelve la geometr?a a partir de un ?ndice.
80
         *
81
         * @param index ?ndice.
82
         *
83
         * @return Geometr?a.
84
         * @throws ReadDriverException TODO
85
         * @throws ExpansionFileReadException
86
         */
87
        IGeometry getShape(int index) throws ReadDriverException, ExpansionFileReadException;
88

    
89
        /**
90
         * Devuelve el n?mero de Shape.
91
         *
92
         * @return N?mero de Shape.
93
         * @throws ReadDriverException TODO
94
         */
95
        int getShapeCount() throws ReadDriverException;
96

    
97
        /**
98
         * Devuelve la extensi?n total de la capa.
99
         *
100
         * @return Extensi?n total.
101
         * @throws ReadDriverException TODO
102
         * @throws ExpansionFileReadException
103
         */
104
        Rectangle2D getFullExtent() throws ReadDriverException, ExpansionFileReadException;
105

    
106
        /**
107
         * Obtiene el tipo de las geometr?as almacenadas en esta fuente de datos
108
         *
109
         * @return Obtiene el tipo de la capa. Es un bit-oring de los tipos
110
         *                    definidos en FShape POINT, LINE, POLYGON o TEXT;
111
         * @throws ReadDriverException TODO
112
         */
113
        int getShapeType() throws ReadDriverException;
114
        /**
115
         * Obtiene una referencia al objeto que implementa la interfaz vectorial
116
         * con el fin de que las Strategy puedan optimizar en funci?n del driver.
117
         *
118
         * @return VectorialDriver
119
         */
120
        public VectorialDriver getDriver();
121
        /**
122
         * Establece el driver sobre el que act?a el adaptador
123
         *
124
         * @param driver
125
         */
126
        public void setDriver(VectorialDriver driver);
127
         /*
128
     * (non-Javadoc)
129
     *
130
     * @see com.iver.cit.gvsig.fmap.layers.VectorialAdapter#getRecordset()
131
     */
132
    public SelectableDataSource getRecordset() throws ReadDriverException;
133
    public DriverAttributes getDriverAttributes();
134

    
135
    /**
136
     * En la implementaci?n por defecto podemos hacer que cada
137
     * feature tenga ID = numero de registro.
138
     * En el DBAdapter podr?amos "overrride" este m?todo y poner
139
     * como ID de la Feature el campo ?nico escogido en
140
     * la base de datos. B?sicamente es por comodidad.
141
     * @param numReg
142
     * @return
143
     * @throws ReadDriverException TODO
144
     * @throws ExpansionFileReadException
145
     */
146
    public IFeature getFeature(int numReg) throws ReadDriverException, ExpansionFileReadException;
147

    
148
    /* public IFeatureIterator getFeatureIterator(String strEPSG) throws DriverException;
149
    public IFeatureIterator getFeatureIterator(Rectangle2D r, String strEPSG) throws DriverException; */
150

    
151
        //void setRecordset(SelectableDataSource sds);
152

    
153

    
154

    
155
}