Statistics
| Revision:

root / trunk / libraries / libGPE / src-test / org / gvsig / gpe / containers / Element.java @ 11635

History | View | Annotate | Download (3.44 KB)

1
package org.gvsig.gpe.containers;
2

    
3
import java.util.ArrayList;
4

    
5

    
6
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
7
 *
8
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
9
 *
10
 * This program is free software; you can redistribute it and/or
11
 * modify it under the terms of the GNU General Public License
12
 * as published by the Free Software Foundation; either version 2
13
 * of the License, or (at your option) any later version.
14
 *
15
 * This program is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 * GNU General Public License for more details.
19
 *
20
 * You should have received a copy of the GNU General Public License
21
 * along with this program; if not, write to the Free Software
22
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
23
 *
24
 * For more information, contact:
25
 *
26
 *  Generalitat Valenciana
27
 *   Conselleria d'Infraestructures i Transport
28
 *   Av. Blasco Ib??ez, 50
29
 *   46010 VALENCIA
30
 *   SPAIN
31
 *
32
 *      +34 963862235
33
 *   gvsig@gva.es
34
 *      www.gvsig.gva.es
35
 *
36
 *    or
37
 *
38
 *   IVER T.I. S.A
39
 *   Salamanca 50
40
 *   46005 Valencia
41
 *   Spain
42
 *
43
 *   +34 963163400
44
 *   dac@iver.es
45
 */
46
/* CVS MESSAGES:
47
 *
48
 * $Id: Element.java 11635 2007-05-15 07:28:34Z jorpiell $
49
 * $Log$
50
 * Revision 1.4  2007-05-15 07:28:34  jorpiell
51
 * Children Element printed
52
 *
53
 * Revision 1.3  2007/05/02 11:46:07  jorpiell
54
 * Writing tests updated
55
 *
56
 * Revision 1.2  2007/04/19 11:50:20  csanchez
57
 * Actualizacion protoripo libGPE
58
 *
59
 * Revision 1.1  2007/04/14 16:06:35  jorpiell
60
 * Add the container classes
61
 *
62
 *
63
 */
64
/**
65
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
66
 */
67
public class Element {
68
        private String name = null;
69
        private String id = null;
70
        private Object value = null;
71
        private Object type = null;
72
        private Element parentElement = null;
73
        private ArrayList elements = new ArrayList();
74
        /**
75
         * @return the id
76
         */
77
        public String getId() {
78
                return id;
79
        }
80
        /**
81
         * @param id the id to set
82
         */
83
        public void setId(String id) {
84
                this.id = id;
85
        }
86
        /**
87
         * @return the name
88
         */
89
        public String getName() {
90
                return name;
91
        }
92
        /**
93
         * @param name the name to set
94
         */
95
        public void setName(String name) {
96
                this.name = name;
97
        }
98
        /**
99
         * @return the type
100
         */
101
        public Object getType() {
102
                return type;
103
        }
104
        /**
105
         * @param type the type to set
106
         */
107
        public void setType(Object type) {
108
                this.type = type;
109
        }
110
        /**
111
         * @return the value
112
         */
113
        public Object getValue() {
114
                return value;
115
        }
116
        /**
117
         * @param value the value to set
118
         */
119
        public void setValue(Object value) {
120
                this.value = value;
121
        }
122

    
123
        /**
124
         * @return the parentElement
125
         */
126
        public Element getParentElement() {
127
                return parentElement;
128
        }
129
        /**
130
         * @param parentElement the parentElement to set
131
         */
132
        public void setParentElement(Object parentElement) {
133
                if (parentElement != null){
134
                        this.parentElement = (Element)parentElement;
135
                        ((Element)parentElement).addChildEElement(this);
136
                }
137
        }
138
        /**
139
         * @return the elements
140
         */
141
        public ArrayList getElements() {
142
                return elements;
143
        }
144
        
145
        /**
146
         * @return the element at position i
147
         * @param i
148
         * Element position
149
         */
150
        public Element getElementAt(int i) {
151
                return (Element)elements.get(i);
152
        }
153
                
154
        /**
155
         * @param parentElement the parentElement to set
156
         */
157
        public void setParentElement(Element parentElement) {
158
                this.parentElement = parentElement;
159
        }
160
        
161
        /**
162
         * @param adds a child element
163
         */
164
        public void addChildEElement(Element element) {
165
                getElements().add(element);
166
        }
167
}