Statistics
| Revision:

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

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