Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libGPE / src-test / org / gvsig / gpe / containers / Feature.java @ 11435

History | View | Annotate | Download (3.02 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 11435 2007-05-02 11:46:50Z jorpiell $
48
 * $Log$
49
 * Revision 1.3  2007-05-02 11:46:07  jorpiell
50
 * Writing tests updated
51
 *
52
 * Revision 1.2  2007/04/19 07:23:20  jorpiell
53
 * Add the add methods to teh contenhandler and change the register mode
54
 *
55
 * Revision 1.1  2007/04/14 16:06:35  jorpiell
56
 * Add the container classes
57
 *
58
 *
59
 */
60
/**
61
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
62
 */
63
public class Feature {
64
        private String name = null;
65
        private String id = null;
66
        private Geometry geometry = null;
67
        private ArrayList elements = new ArrayList();
68
        /**
69
         * @return the geometry
70
         */
71
        public Geometry getGeometry() {
72
                return geometry;
73
        }
74
        /**
75
         * @param geometry the geometry to set
76
         */
77
        public void setGeometry(Geometry geometry) {
78
                this.geometry = geometry;
79
        }
80
        
81
        /**
82
         * @param geometry the geometry to set
83
         */
84
        public void setGeometry(Object geometry) {
85
                if (geometry instanceof Geometry){
86
                        this.geometry = (Geometry)geometry;
87
                }
88
        }
89
        
90
        /**
91
         * @return the id
92
         */
93
        public String getId() {
94
                return id;
95
        }
96
        /**
97
         * @param id the id to set
98
         */
99
        public void setId(String id) {
100
                this.id = id;
101
        }
102
        /**
103
         * @return the name
104
         */
105
        public String getName() {
106
                return name;
107
        }
108
        /**
109
         * @param name the name to set
110
         */
111
        public void setName(String name) {
112
                this.name = name;
113
        }
114
        /**
115
         * @return the elements
116
         */
117
        public ArrayList getElements() {
118
                return elements;
119
        }
120
        
121
        /**
122
         * @return the element at position i
123
         * @param i
124
         * Element position
125
         */
126
        public Element getElementAt(int i) {
127
                return (Element)elements.get(i);
128
        }
129
        
130
        /**
131
         * Adds a new element
132
         * @param layer
133
         */
134
        public void addElement(Element element){
135
                elements.add(element);
136
        }
137
        
138
        /**
139
         * Adds a new element
140
         * @param layer
141
         */
142
        public void addElement(Object element){
143
                if (element instanceof Element){
144
                        elements.add(element);
145
                }
146
        }
147
}