Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libGPE-GML / src / org / gvsig / gpe / gml / IGMLFeaturesIterator.java @ 11694

History | View | Annotate | Download (3.1 KB)

1
package org.gvsig.gpe.gml;
2

    
3
import org.gvsig.exceptions.BaseException;
4
import org.gvsig.gpe.gml.exceptions.GMLException;
5
import org.gvsig.gpe.gml.factories.IGeometriesFactory;
6
import org.gvsig.gpe.gml.schemas.XMLSchemaParser;
7

    
8

    
9
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
10
 *
11
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
12
 *
13
 * This program is free software; you can redistribute it and/or
14
 * modify it under the terms of the GNU General Public License
15
 * as published by the Free Software Foundation; either version 2
16
 * of the License, or (at your option) any later version.
17
 *
18
 * This program is distributed in the hope that it will be useful,
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
 * GNU General Public License for more details.
22
 *
23
 * You should have received a copy of the GNU General Public License
24
 * along with this program; if not, write to the Free Software
25
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
26
 *
27
 * For more information, contact:
28
 *
29
 *  Generalitat Valenciana
30
 *   Conselleria d'Infraestructures i Transport
31
 *   Av. Blasco Ib??ez, 50
32
 *   46010 VALENCIA
33
 *   SPAIN
34
 *
35
 *      +34 963862235
36
 *   gvsig@gva.es
37
 *      www.gvsig.gva.es
38
 *
39
 *    or
40
 *
41
 *   IVER T.I. S.A
42
 *   Salamanca 50
43
 *   46005 Valencia
44
 *   Spain
45
 *
46
 *   +34 963163400
47
 *   dac@iver.es
48
 */
49
/* CVS MESSAGES:
50
 *
51
 * $Id: IGMLFeaturesIterator.java 10550 2007-02-28 11:49:30Z csanchez $
52
 * $Log$
53
 * Revision 1.1  2007-02-28 11:48:31  csanchez
54
 * *** empty log message ***
55
 *
56
 * Revision 1.1  2007/02/20 10:53:20  jorpiell
57
 * A?adidos los proyectos de kml y gml antiguos
58
 *
59
 * Revision 1.3  2007/01/15 13:11:00  csanchez
60
 * Sistema de Warnings y Excepciones adaptado a BasicException
61
 *
62
 * Revision 1.2  2006/12/22 11:25:44  csanchez
63
 * Nuevo parser GML 2.x para gml's sin esquema
64
 *
65
 * Revision 1.1  2006/08/10 12:00:49  jorpiell
66
 * Primer commit del driver de Gml
67
 *
68
 *
69
 */
70
/**
71
 * Iterator to retrieve the GML objects parsed. It must to
72
 * be implemented by the iterators for GML 2.x and 3.x
73
 * @author Jorge Piera Llodr? (piera_jor@gva.es)
74
 * @author Carlos S?nchez Peri??n (sanchez_carper@gva.es)
75
 * 
76
 */
77
public abstract class IGMLFeaturesIterator {
78
        private XMLSchemaParser parser = null;
79
        private IGeometriesFactory factory = null;
80
        private String featureRoot = null; 
81

    
82
        
83
        public IGMLFeaturesIterator(XMLSchemaParser parser, IGeometriesFactory factory) {
84
                this.parser = parser;
85
                this.factory = factory;
86
                //It takes the <featureMember> like featureRoot
87
                featureRoot = parser.getName();
88
        }
89
        /**
90
         * It Returns true if there are more features to parse
91
         * @return
92
         * @throws BaseException 
93
         */
94
        public abstract boolean hasNext()throws GMLException;
95
    
96
        /**
97
         * It returns the next feature
98
         * @return
99
         */
100
        public abstract Object next()throws GMLException;        
101
        
102
        /**
103
         * @return Returns the featureRoot.
104
         */
105
        public String getFeatureRoot() {
106
                return featureRoot;
107
        }
108
        /**
109
         * @return Returns the factory.
110
         */
111
        public IGeometriesFactory getFactory() {
112
                return factory;
113
        }
114
        /**
115
         * @return Returns the parser.
116
         */
117
        public XMLSchemaParser getParser() {
118
                return parser;
119
        }
120
}