root / branches / Mobile1.0 / org.gvsig.gpe / src-test / org / gvsig / gpe / containers / Element.java @ 79
History | View | Annotate | Download (3.74 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 108 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 namespace = null; |
69 |
private String name = null; |
70 |
private String id = null; |
71 |
private Object value = null; |
72 |
private Object type = null; |
73 |
private Element parentElement = null; |
74 |
private ArrayList elements = new ArrayList(); |
75 |
/**
|
76 |
* @return the id
|
77 |
*/
|
78 |
public String getId() { |
79 |
return id;
|
80 |
} |
81 |
/**
|
82 |
* @param id the id to set
|
83 |
*/
|
84 |
public void setId(String id) { |
85 |
this.id = id;
|
86 |
} |
87 |
/**
|
88 |
* @return the name
|
89 |
*/
|
90 |
public String getName() { |
91 |
return name;
|
92 |
} |
93 |
/**
|
94 |
* @param name the name to set
|
95 |
*/
|
96 |
public void setName(String name) { |
97 |
this.name = name;
|
98 |
} |
99 |
/**
|
100 |
* @return the type
|
101 |
*/
|
102 |
public Object getType() { |
103 |
return type;
|
104 |
} |
105 |
/**
|
106 |
* @param type the type to set
|
107 |
*/
|
108 |
public void setType(Object type) { |
109 |
this.type = type;
|
110 |
} |
111 |
/**
|
112 |
* @return the value
|
113 |
*/
|
114 |
public Object getValue() { |
115 |
return value;
|
116 |
} |
117 |
/**
|
118 |
* @param value the value to set
|
119 |
*/
|
120 |
public void setValue(Object value) { |
121 |
this.value = value;
|
122 |
} |
123 |
|
124 |
/**
|
125 |
* @return the parentElement
|
126 |
*/
|
127 |
public Element getParentElement() { |
128 |
return parentElement;
|
129 |
} |
130 |
/**
|
131 |
* @param parentElement the parentElement to set
|
132 |
*/
|
133 |
public void setParentElement(Object parentElement) { |
134 |
if (parentElement != null){ |
135 |
this.parentElement = (Element)parentElement; |
136 |
((Element)parentElement).addChildEElement(this); |
137 |
} |
138 |
} |
139 |
/**
|
140 |
* @return the elements
|
141 |
*/
|
142 |
public ArrayList getElements() { |
143 |
return elements;
|
144 |
} |
145 |
|
146 |
/**
|
147 |
* @return the element at position i
|
148 |
* @param i
|
149 |
* Element position
|
150 |
*/
|
151 |
public Element getElementAt(int i) { |
152 |
return (Element)elements.get(i); |
153 |
} |
154 |
|
155 |
/**
|
156 |
* @param parentElement the parentElement to set
|
157 |
*/
|
158 |
public void setParentElement(Element parentElement) { |
159 |
this.parentElement = parentElement;
|
160 |
} |
161 |
|
162 |
/**
|
163 |
* @param adds a child element
|
164 |
*/
|
165 |
public void addChildEElement(Element element) { |
166 |
getElements().add(element); |
167 |
} |
168 |
/**
|
169 |
* @return the namespace
|
170 |
*/
|
171 |
public String getNamespace() { |
172 |
return namespace;
|
173 |
} |
174 |
/**
|
175 |
* @param namespace the namespace to set
|
176 |
*/
|
177 |
public void setNamespace(String namespace) { |
178 |
this.namespace = namespace;
|
179 |
} |
180 |
} |