1 package org.djunits.value.vfloat.vector;
2
3 import java.util.List;
4 import java.util.SortedMap;
5
6 import org.djunits.unit.AbsoluteLinearUnit;
7 import org.djunits.unit.Unit;
8 import org.djunits.value.StorageType;
9 import org.djunits.value.ValueException;
10 import org.djunits.value.vfloat.scalar.FloatScalar;
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 public abstract class MutableFloatVector
26 {
27
28
29
30
31
32 public static class Abs<AU extends AbsoluteLinearUnit<AU, RU>, RU extends Unit<RU>> extends AbstractMutableFloatVectorAbs<
33 AU, RU, FloatVector.Abs<AU, RU>, FloatVector.Rel<RU>, MutableFloatVector.Abs<AU, RU>, FloatScalar.Abs<AU, RU>>
34 {
35
36 private static final long serialVersionUID = 20150626L;
37
38
39
40
41
42
43
44
45 public Abs(final float[] values, final AU unit, final StorageType storageType) throws ValueException
46 {
47 super(values, unit, storageType);
48 }
49
50
51
52
53
54
55
56
57 public Abs(final List<Float> values, final AU unit, final StorageType storageType) throws ValueException
58 {
59 super(values, unit, storageType);
60 }
61
62
63
64
65
66
67
68 public Abs(final FloatScalar.Abs<AU, RU>[] values, final StorageType storageType) throws ValueException
69 {
70 super(values, storageType);
71 }
72
73
74
75
76
77
78
79 public Abs(final List<FloatScalar.Abs<AU, RU>> values, final StorageType storageType) throws ValueException
80 {
81 super(values, storageType);
82 }
83
84
85
86
87
88
89
90
91 public Abs(final SortedMap<Integer, FloatScalar.Abs<AU, RU>> values, final int length, final StorageType storageType)
92 throws ValueException
93 {
94 super(values, length, storageType);
95 }
96
97
98
99
100
101
102
103
104
105 public Abs(final SortedMap<Integer, Float> values, final AU unit, final int length, final StorageType storageType)
106 throws ValueException
107 {
108 super(values, unit, length, storageType);
109 }
110
111
112
113
114
115
116 public Abs(final FloatVectorData data, final AU unit)
117 {
118 super(data, unit);
119 }
120
121
122 @Override
123 protected final FloatVector.Abs<AU, RU> instantiateTypeAbs(final FloatVectorData dvd, final AU unit)
124 {
125 return new FloatVector.Abs<AU, RU>(dvd, unit);
126 }
127
128
129 @Override
130 protected final FloatVector.Rel<RU> instantiateTypeRel(final FloatVectorData dvd, final RU unit)
131 {
132 return new FloatVector.Rel<RU>(dvd, unit);
133 }
134
135
136 @Override
137 protected final MutableFloatVector.Abs<AU, RU> instantiateMutableType(final FloatVectorData dvd, final AU unit)
138 {
139 return new MutableFloatVector.Abs<AU, RU>(dvd, unit);
140 }
141
142
143 @Override
144 protected final FloatScalar.Abs<AU, RU> instantiateScalar(final float value, final AU unit)
145 {
146 return new FloatScalar.Abs<AU, RU>(value, unit);
147 }
148
149
150 @Override
151 public final MutableFloatVector.Abs<AU, RU> toDense()
152 {
153 return this.data.isDense() ? (MutableFloatVector.Abs<AU, RU>) this
154 : instantiateMutableType(this.data.toDense(), getUnit());
155 }
156
157
158 @Override
159 public final MutableFloatVector.Abs<AU, RU> toSparse()
160 {
161 return this.data.isSparse() ? (MutableFloatVector.Abs<AU, RU>) this
162 : instantiateMutableType(this.data.toSparse(), getUnit());
163 }
164 }
165
166
167
168
169
170 public static class Rel<U extends Unit<U>>
171 extends AbstractMutableFloatVectorRel<U, FloatVector.Rel<U>, MutableFloatVector.Rel<U>, FloatScalar.Rel<U>>
172 {
173
174 private static final long serialVersionUID = 20150626L;
175
176
177
178
179
180
181
182
183 public Rel(final float[] values, final U unit, final StorageType storageType) throws ValueException
184 {
185 super(values, unit, storageType);
186 }
187
188
189
190
191
192
193
194
195 public Rel(final List<Float> values, final U unit, final StorageType storageType) throws ValueException
196 {
197 super(values, unit, storageType);
198 }
199
200
201
202
203
204
205
206 public Rel(final FloatScalar.Rel<U>[] values, final StorageType storageType) throws ValueException
207 {
208 super(values, storageType);
209 }
210
211
212
213
214
215
216
217 public Rel(final List<FloatScalar.Rel<U>> values, final StorageType storageType) throws ValueException
218 {
219 super(values, storageType);
220 }
221
222
223
224
225
226
227
228
229 public Rel(final SortedMap<Integer, FloatScalar.Rel<U>> values, final int length, final StorageType storageType)
230 throws ValueException
231 {
232 super(values, length, storageType);
233 }
234
235
236
237
238
239
240
241
242
243 public Rel(final SortedMap<Integer, Float> values, final U unit, final int length, final StorageType storageType)
244 throws ValueException
245 {
246 super(values, unit, length, storageType);
247 }
248
249
250
251
252
253
254 public Rel(final FloatVectorData data, final U unit)
255 {
256 super(data, unit);
257 }
258
259
260 @Override
261 protected final FloatVector.Rel<U> instantiateType(final FloatVectorData dvd, final U unit)
262 {
263 return new FloatVector.Rel<U>(dvd, unit);
264 }
265
266
267 @Override
268 protected final MutableFloatVector.Rel<U> instantiateMutableType(final FloatVectorData dvd, final U unit)
269 {
270 return new MutableFloatVector.Rel<U>(dvd, unit);
271 }
272
273
274 @Override
275 protected final FloatScalar.Rel<U> instantiateScalar(final float value, final U unit)
276 {
277 return new FloatScalar.Rel<U>(value, unit);
278 }
279
280
281 @Override
282 public final MutableFloatVector.Rel<U> toDense()
283 {
284 return this.data.isDense() ? (MutableFloatVector.Rel<U>) this
285 : instantiateMutableType(this.data.toDense(), getUnit());
286 }
287
288
289 @Override
290 public final MutableFloatVector.Rel<U> toSparse()
291 {
292 return this.data.isSparse() ? (MutableFloatVector.Rel<U>) this
293 : instantiateMutableType(this.data.toSparse(), getUnit());
294 }
295
296 }
297
298 }