root / trunk / libraries / libGPE / src-test / org / gvsig / gpe / containers / Feature.java @ 11247
History | View | Annotate | Download (2.79 KB)
1 |
package org.gvsig.gpe.containers; |
---|---|
2 |
|
3 |
import java.util.ArrayList; |
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: Feature.java 11247 2007-04-19 07:30:40Z jorpiell $
|
48 |
* $Log$
|
49 |
* Revision 1.2 2007-04-19 07:23:20 jorpiell
|
50 |
* Add the add methods to teh contenhandler and change the register mode
|
51 |
*
|
52 |
* Revision 1.1 2007/04/14 16:06:35 jorpiell
|
53 |
* Add the container classes
|
54 |
*
|
55 |
*
|
56 |
*/
|
57 |
/**
|
58 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es)
|
59 |
*/
|
60 |
public class Feature { |
61 |
private String name = null; |
62 |
private String id = null; |
63 |
private Geometry geometry = null; |
64 |
private ArrayList elements = new ArrayList(); |
65 |
/**
|
66 |
* @return the geometry
|
67 |
*/
|
68 |
public Geometry getGeometry() {
|
69 |
return geometry;
|
70 |
} |
71 |
/**
|
72 |
* @param geometry the geometry to set
|
73 |
*/
|
74 |
public void setGeometry(Geometry geometry) { |
75 |
this.geometry = geometry;
|
76 |
} |
77 |
|
78 |
/**
|
79 |
* @param geometry the geometry to set
|
80 |
*/
|
81 |
public void setGeometry(Object geometry) { |
82 |
if (geometry instanceof Geometry){ |
83 |
this.geometry = (Geometry)geometry;
|
84 |
} |
85 |
} |
86 |
|
87 |
/**
|
88 |
* @return the id
|
89 |
*/
|
90 |
public String getId() { |
91 |
return id;
|
92 |
} |
93 |
/**
|
94 |
* @param id the id to set
|
95 |
*/
|
96 |
public void setId(String id) { |
97 |
this.id = id;
|
98 |
} |
99 |
/**
|
100 |
* @return the name
|
101 |
*/
|
102 |
public String getName() { |
103 |
return name;
|
104 |
} |
105 |
/**
|
106 |
* @param name the name to set
|
107 |
*/
|
108 |
public void setName(String name) { |
109 |
this.name = name;
|
110 |
} |
111 |
/**
|
112 |
* @return the elements
|
113 |
*/
|
114 |
public ArrayList getElements() { |
115 |
return elements;
|
116 |
} |
117 |
|
118 |
/**
|
119 |
* Adds a new element
|
120 |
* @param layer
|
121 |
*/
|
122 |
public void addElement(Element element){ |
123 |
elements.add(element); |
124 |
} |
125 |
|
126 |
/**
|
127 |
* Adds a new element
|
128 |
* @param layer
|
129 |
*/
|
130 |
public void addElement(Object element){ |
131 |
if (element instanceof Element){ |
132 |
elements.add(element); |
133 |
} |
134 |
} |
135 |
} |