Statistics
| Revision:

gvsig-vectorediting / org.gvsig.vectorediting / trunk / org.gvsig.vectorediting / org.gvsig.vectorediting.lib / org.gvsig.vectorediting.lib.spi / src / main / java / org / gvsig / vectorediting / lib / spi / DefaultEditingServiceParameter.java @ 2109

History | View | Annotate | Download (5.37 KB)

1 159 llmarques
/**
2
 * gvSIG. Desktop Geographic Information System.
3 52 fdiaz
 *
4 159 llmarques
 * Copyright ? 2007-2014 gvSIG Association
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23 4 llmarques
 */
24 159 llmarques
25 4 llmarques
package org.gvsig.vectorediting.lib.spi;
26
27 191 llmarques
import java.util.Arrays;
28 156 llmarques
import java.util.HashSet;
29 191 llmarques
import java.util.Map;
30 156 llmarques
import java.util.Set;
31 53 fdiaz
32 157 llmarques
import org.gvsig.fmap.geom.Geometry;
33 4 llmarques
import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
34
35 10 llmarques
public class DefaultEditingServiceParameter implements EditingServiceParameter {
36 4 llmarques
37 157 llmarques
    private String name;
38 10 llmarques
39 157 llmarques
    private String description;
40 10 llmarques
41 157 llmarques
    private Set<TYPE> types;
42 52 fdiaz
43 157 llmarques
    private int geometryType;
44
45 191 llmarques
    private Map<String, String> options;
46 227 llmarques
47 365 llmarques
    private Object defaultValue;
48
49 157 llmarques
    public DefaultEditingServiceParameter(String theName,
50
        String theDescription, TYPE... theTypes) {
51 227 llmarques
52 157 llmarques
        this.name = theName;
53
        this.description = theDescription;
54
        this.geometryType = Geometry.TYPES.NULL;
55
        this.types = new HashSet<EditingServiceParameter.TYPE>();
56 191 llmarques
        this.types.addAll(Arrays.asList(theTypes));
57 157 llmarques
58 156 llmarques
    }
59 4 llmarques
60 157 llmarques
    public DefaultEditingServiceParameter(String theName,
61 365 llmarques
        Object theDefaultValue, String theDescription, TYPE... theTypes) {
62
63
        this.name = theName;
64
        this.description = theDescription;
65
        this.geometryType = Geometry.TYPES.NULL;
66
        this.types = new HashSet<EditingServiceParameter.TYPE>();
67
        this.types.addAll(Arrays.asList(theTypes));
68
        this.defaultValue = theDefaultValue;
69
    }
70
71
    public DefaultEditingServiceParameter(String theName,
72 157 llmarques
        String theDescription, int theGeometryType, TYPE... theTypes) {
73 191 llmarques
74 157 llmarques
        this.name = theName;
75
        this.description = theDescription;
76
        this.geometryType = theGeometryType;
77
        this.types = new HashSet<EditingServiceParameter.TYPE>();
78 191 llmarques
        this.types.addAll(Arrays.asList(theTypes));
79 4 llmarques
80 157 llmarques
    }
81 4 llmarques
82 191 llmarques
    public DefaultEditingServiceParameter(String theName,
83 365 llmarques
        String theDescription, Object theDefaultValue, int theGeometryType,
84
        TYPE... theTypes) {
85
86
        this.name = theName;
87
        this.description = theDescription;
88
        this.geometryType = theGeometryType;
89
        this.types = new HashSet<EditingServiceParameter.TYPE>();
90
        this.types.addAll(Arrays.asList(theTypes));
91
        this.defaultValue = theDefaultValue;
92
93
    }
94
95
    public DefaultEditingServiceParameter(String theName,
96 191 llmarques
        String theDescription, Map<String, String> theOptions, TYPE... theTypes) {
97
98
        this.name = theName;
99
        this.description = theDescription;
100
101
        this.types = new HashSet<EditingServiceParameter.TYPE>();
102
        this.types.addAll(Arrays.asList(theTypes));
103
104
        this.options = theOptions;
105
    }
106 377 fdiaz
107 365 llmarques
    public DefaultEditingServiceParameter(String theName,
108
        String theDescription, Map<String, String> theOptions, Object theDefaultValue, TYPE... theTypes) {
109 191 llmarques
110 365 llmarques
        this.name = theName;
111
        this.description = theDescription;
112
113
        this.types = new HashSet<EditingServiceParameter.TYPE>();
114
        this.types.addAll(Arrays.asList(theTypes));
115
116
        this.options = theOptions;
117
        this.defaultValue = theDefaultValue;
118
    }
119
120 191 llmarques
    public DefaultEditingServiceParameter(String theName,
121
        String theDescription, int theGeometryType,
122
        Map<String, String> theOptions, TYPE... theTypes) {
123
124
        this.name = theName;
125
        this.description = theDescription;
126
        this.geometryType = theGeometryType;
127
128
        this.types = new HashSet<EditingServiceParameter.TYPE>();
129
        this.types.addAll(Arrays.asList(theTypes));
130
131
        this.options = theOptions;
132
133
    }
134 377 fdiaz
135 365 llmarques
    public DefaultEditingServiceParameter(String theName,
136
        String theDescription, int theGeometryType,
137
        Map<String, String> theOptions, Object theDefaultValue, TYPE... theTypes) {
138 191 llmarques
139 365 llmarques
        this.name = theName;
140
        this.description = theDescription;
141
        this.geometryType = theGeometryType;
142
143
        this.types = new HashSet<EditingServiceParameter.TYPE>();
144
        this.types.addAll(Arrays.asList(theTypes));
145
146
        this.options = theOptions;
147
        this.defaultValue = theDefaultValue;
148
    }
149
150 157 llmarques
    public Set<TYPE> getTypes() {
151
        return types;
152
    }
153 4 llmarques
154 157 llmarques
    public String getName() {
155
        return name;
156
    }
157 57 llmarques
158 157 llmarques
    public String getDescription() {
159
        return description;
160
    }
161
162
    public void setDescription(String newDescription) {
163
        this.description = newDescription;
164
    }
165
166
    public int getGeometryType() {
167
        return this.geometryType;
168
    }
169
170 227 llmarques
    public Map<String, String> getOptions() {
171 191 llmarques
        return this.options;
172
    }
173
174 365 llmarques
    public Object getDefaultValue() {
175
        return this.defaultValue;
176
    }
177
178 377 fdiaz
    public void setDefaultValue(Object value) {
179
        this.defaultValue = value;
180
    }
181
182 4 llmarques
}