Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / drivers / VectorialFileDriver.java @ 12773

History | View | Annotate | Download (3.3 KB)

1 1100 fjp
/* 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 214 fernando
package com.iver.cit.gvsig.fmap.drivers;
42
43
import java.io.File;
44
import java.io.IOException;
45
46 10627 caballero
import com.hardcode.gdbms.driver.exceptions.CloseDriverException;
47
import com.hardcode.gdbms.driver.exceptions.InitializeDriverException;
48
import com.hardcode.gdbms.driver.exceptions.OpenDriverException;
49 408 fernando
50 1828 fernando
51 408 fernando
/**
52
 * Interfaz a implementar por los drivers. El constructor no ha de tener
53
 * par?metros y ha de ser r?pido, para las tareas de inicializaci?n de la capa
54
 * se deber? de utilizar initialize.
55
 */
56 214 fernando
public interface VectorialFileDriver extends VectorialDriver {
57 408 fernando
    /**
58
     * Abre el fichero para una serie de operaciones.
59
     *
60
     * @param f Fichero sobre el que se va a operar
61
     *
62
     * @throws IOException Si se produce alg?n error
63
     */
64 10627 caballero
    void open(File f) throws OpenDriverException;
65 214 fernando
66 408 fernando
    /**
67
     * Cuando se terminan las operaciones sobre el fichero se invoca ?ste
68
     * m?todo para cerrar el descriptor que se abri? en f
69
     *
70
     * @throws IOException Si se produce alg?n error
71
     */
72 10627 caballero
    void close() throws CloseDriverException;
73 214 fernando
74 408 fernando
75
    /**
76
     * M?todo invocado una s?la vez durante la ejecuci?n justo antes
77
     * de visualizar una capa. En ?l se deben de hacer las inicializaciones
78
     * necesarias
79 10627 caballero
     * @throws OpenDriverException
80 408 fernando
     *
81
     * @throws IOException Si se produce alg?n error
82
     */
83 10627 caballero
    void initialize() throws InitializeDriverException, OpenDriverException;
84 408 fernando
85
    /**
86
     * Define los tipos de fichero que puede leer el driver. Si devuelve true,
87
     * el fichero est? aceptado (es de los que el driver puede leer), si
88
     * devuelve false es porque no lo puede leer.
89
     *
90 1005 vcaballero
     * @param f Fichero
91 408 fernando
     *
92 1005 vcaballero
     * @return boolean
93 408 fernando
     */
94
    boolean accept(File f);
95 10627 caballero
96 1691 fjp
    /**
97
     * Obtiene del fichero abierto en open la geometr?a index-?sima
98
     *
99
     * @param index ?ndice de la geometr?a que se quiere obtener
100
     *
101
     * @return IGeometry. Construida mediante llamadas a ShapeFactory
102
     *
103
     * @throws IOException Si se produce alg?n error
104
     */
105 3271 fjp
    // IGeometry getShape(int index) throws IOException;
106 1691 fjp
107 3720 fjp
    /**
108
     * @return the original File that we are opening.
109
     */
110
    File getFile();
111 10627 caballero
112
113 214 fernando
}