root / branches / v2_0_0_prep / libraries / libFMap_data / src / org / gvsig / fmap / data / feature / impl / DefaultEditableFeature.java @ 23754
History | View | Annotate | Download (5.12 KB)
1 |
package org.gvsig.fmap.data.feature.impl; |
---|---|
2 |
|
3 |
import java.util.Date; |
4 |
|
5 |
import org.gvsig.fmap.data.feature.EditableFeature; |
6 |
import org.gvsig.fmap.data.feature.Feature; |
7 |
import org.gvsig.fmap.data.feature.FeatureAttributeDescriptor; |
8 |
import org.gvsig.fmap.geom.Geometry; |
9 |
|
10 |
public class DefaultEditableFeature extends DefaultFeature implements |
11 |
EditableFeature { |
12 |
private DefaultFeature source;
|
13 |
|
14 |
protected DefaultEditableFeature(DefaultFeature feature) {
|
15 |
super(feature);
|
16 |
this.source = feature;
|
17 |
} |
18 |
|
19 |
protected DefaultEditableFeature(DefaultEditableFeature feature) {
|
20 |
super(feature);
|
21 |
this.source = feature.getSource();
|
22 |
} |
23 |
|
24 |
public DefaultFeature getSource() {
|
25 |
return this.source; |
26 |
} |
27 |
|
28 |
public EditableFeature getEditable() {
|
29 |
return this; |
30 |
} |
31 |
|
32 |
public Feature getCopy() {
|
33 |
return new DefaultEditableFeature(this); |
34 |
} |
35 |
|
36 |
|
37 |
public Feature getNotEditableCopy() {
|
38 |
return new DefaultFeature(this); |
39 |
} |
40 |
|
41 |
public void set(String name, Object value) { |
42 |
FeatureAttributeDescriptor attribute = this.getType()
|
43 |
.getAttributeDescriptor(name); |
44 |
this.set(attribute, value);
|
45 |
} |
46 |
|
47 |
public void set(int index, Object value) { |
48 |
FeatureAttributeDescriptor attribute = this.getType()
|
49 |
.getAttributeDescriptor(index); |
50 |
this.set(attribute, value);
|
51 |
} |
52 |
|
53 |
public void setArray(String name, Object[] value) { |
54 |
FeatureAttributeDescriptor attribute = this.getType()
|
55 |
.getAttributeDescriptor(name); |
56 |
this.set(attribute, value);
|
57 |
} |
58 |
|
59 |
public void setArray(int index, Object[] value) { |
60 |
FeatureAttributeDescriptor attribute = this.getType()
|
61 |
.getAttributeDescriptor(index); |
62 |
this.set(attribute, value);
|
63 |
} |
64 |
|
65 |
public void setBoolean(String name, boolean value) { |
66 |
FeatureAttributeDescriptor attribute = this.getType()
|
67 |
.getAttributeDescriptor(name); |
68 |
this.set(attribute, Boolean.valueOf(value)); |
69 |
} |
70 |
|
71 |
public void setBoolean(int index, boolean value) { |
72 |
FeatureAttributeDescriptor attribute = this.getType()
|
73 |
.getAttributeDescriptor(index); |
74 |
this.set(attribute, Boolean.valueOf(value)); |
75 |
} |
76 |
|
77 |
public void setByte(String name, byte value) { |
78 |
FeatureAttributeDescriptor attribute = this.getType()
|
79 |
.getAttributeDescriptor(name); |
80 |
this.set(attribute, Byte.valueOf(value)); |
81 |
} |
82 |
|
83 |
public void setByte(int index, byte value) { |
84 |
FeatureAttributeDescriptor attribute = this.getType()
|
85 |
.getAttributeDescriptor(index); |
86 |
this.set(attribute, Byte.valueOf(value)); |
87 |
} |
88 |
|
89 |
public void setDate(String name, Date value) { |
90 |
FeatureAttributeDescriptor attribute = this.getType()
|
91 |
.getAttributeDescriptor(name); |
92 |
this.set(attribute, value);
|
93 |
} |
94 |
|
95 |
public void setDate(int index, Date value) { |
96 |
FeatureAttributeDescriptor attribute = this.getType()
|
97 |
.getAttributeDescriptor(index); |
98 |
this.set(attribute, value);
|
99 |
} |
100 |
|
101 |
public void setDouble(String name, double value) { |
102 |
FeatureAttributeDescriptor attribute = this.getType()
|
103 |
.getAttributeDescriptor(name); |
104 |
this.set(attribute, Double.valueOf(value)); |
105 |
} |
106 |
|
107 |
public void setDouble(int index, double value) { |
108 |
FeatureAttributeDescriptor attribute = this.getType()
|
109 |
.getAttributeDescriptor(index); |
110 |
this.set(attribute, Double.valueOf(value)); |
111 |
} |
112 |
|
113 |
public void setFeature(String name, Feature value) { |
114 |
FeatureAttributeDescriptor attribute = this.getType()
|
115 |
.getAttributeDescriptor(name); |
116 |
this.set(attribute, value);
|
117 |
} |
118 |
|
119 |
public void setFeature(int index, Feature value) { |
120 |
FeatureAttributeDescriptor attribute = this.getType()
|
121 |
.getAttributeDescriptor(index); |
122 |
this.set(attribute, value);
|
123 |
} |
124 |
|
125 |
public void setFloat(String name, float value) { |
126 |
FeatureAttributeDescriptor attribute = this.getType()
|
127 |
.getAttributeDescriptor(name); |
128 |
this.set(attribute, Float.valueOf(value)); |
129 |
} |
130 |
|
131 |
public void setFloat(int index, float value) { |
132 |
FeatureAttributeDescriptor attribute = this.getType()
|
133 |
.getAttributeDescriptor(index); |
134 |
this.set(attribute, Float.valueOf(value)); |
135 |
} |
136 |
|
137 |
public void setGeometry(String name, Geometry value) { |
138 |
FeatureAttributeDescriptor attribute = this.getType()
|
139 |
.getAttributeDescriptor(name); |
140 |
this.set(attribute, value);
|
141 |
} |
142 |
|
143 |
public void setGeometry(int index, Geometry value) { |
144 |
FeatureAttributeDescriptor attribute = this.getType()
|
145 |
.getAttributeDescriptor(index); |
146 |
this.set(attribute, value);
|
147 |
} |
148 |
|
149 |
public void setInt(String name, int value) { |
150 |
FeatureAttributeDescriptor attribute = this.getType()
|
151 |
.getAttributeDescriptor(name); |
152 |
this.set(attribute, Integer.valueOf(value)); |
153 |
} |
154 |
|
155 |
public void setInt(int index, int value) { |
156 |
FeatureAttributeDescriptor attribute = this.getType()
|
157 |
.getAttributeDescriptor(index); |
158 |
this.set(attribute, Integer.valueOf(value)); |
159 |
} |
160 |
|
161 |
public void setLong(String name, long value) { |
162 |
FeatureAttributeDescriptor attribute = this.getType()
|
163 |
.getAttributeDescriptor(name); |
164 |
this.set(attribute, Long.valueOf(value)); |
165 |
} |
166 |
|
167 |
public void setLong(int index, long value) { |
168 |
FeatureAttributeDescriptor attribute = this.getType()
|
169 |
.getAttributeDescriptor(index); |
170 |
this.set(attribute, Long.valueOf(value)); |
171 |
} |
172 |
|
173 |
public void setString(String name, String value) { |
174 |
FeatureAttributeDescriptor attribute = this.getType()
|
175 |
.getAttributeDescriptor(name); |
176 |
this.set(attribute, value);
|
177 |
} |
178 |
|
179 |
public void setString(int index, String value) { |
180 |
FeatureAttributeDescriptor attribute = this.getType()
|
181 |
.getAttributeDescriptor(index); |
182 |
this.set(attribute, value);
|
183 |
} |
184 |
|
185 |
} |