Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / extensions / extGPE-gvSIG / src / org / gvsig / fmap / dal / store / gpe / model / GPEElement.java @ 32051

History | View | Annotate | Download (2.48 KB)

1
package org.gvsig.fmap.dal.store.gpe.model;
2

    
3
import java.util.HashMap;
4

    
5
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
6
 *
7
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
8
 *
9
 * This program is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation; either version 2
12
 * of the License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
22
 *
23
 * For more information, contact:
24
 *
25
 *  Generalitat Valenciana
26
 *   Conselleria d'Infraestructures i Transport
27
 *   Av. Blasco Ib??ez, 50
28
 *   46010 VALENCIA
29
 *   SPAIN
30
 *
31
 *      +34 963862235
32
 *   gvsig@gva.es
33
 *      www.gvsig.gva.es
34
 *
35
 *    or
36
 *
37
 *   IVER T.I. S.A
38
 *   Salamanca 50
39
 *   46005 Valencia
40
 *   Spain
41
 *
42
 *   +34 963163400
43
 *   dac@iver.es
44
 */
45
/* CVS MESSAGES:
46
 *
47
 * $Id$
48
 * $Log$
49
 *
50
 */
51
/**
52
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
53
 */
54
public class GPEElement {
55
        private String name = null;
56
        private String value = null;
57
        private HashMap subElements = null;
58
        
59
        public GPEElement(String name, String value) {
60
                super();
61
                this.name = name;
62
                this.value = value;
63
                subElements = new HashMap();
64
        }
65
        
66
        public GPEElement(String name, String value, GPEElement parentElement) {
67
                this(name,value);
68
                //If it is a complex value
69
                if (parentElement != null){
70
                        parentElement.addChildElement(this);                        
71
                }
72
        }        
73
        
74
        /**
75
         * It adds a new child element
76
         * @param children
77
         * The element to add
78
         */
79
        public void addChildElement(GPEElement children){
80
                subElements.put(children.getName(), children);
81
        }
82
        
83
        /**
84
         * @return the name
85
         */
86
        public String getName() {
87
                return name;
88
        }
89
        
90
        /**
91
         * @return the value
92
         */
93
        public String getValue() {
94
                if (subElements.size() > 0){
95
//                        ComplexValue cValue = ValueFactory.createComplexValue(name);
96
//                        Iterator it = subElements.keySet().iterator();
97
//                        while(it.hasNext()){
98
//                                GPEElement element = (GPEElement)subElements.get(it.next());
99
//                                cValue.put(element.getName(), element.getValue());
100
//                        }
101
//                        return cValue;
102
                }
103
                return value;                
104
        }
105
}