1 package org.djunits.value.vfloat.matrix;
2
3 import org.djunits.unit.DurationUnit;
4 import org.djunits.value.StorageType;
5 import org.djunits.value.ValueException;
6 import org.djunits.value.vfloat.scalar.FloatDuration;
7
8
9
10
11
12
13
14
15
16
17
18
19 public class MutableFloatDurationMatrix
20 extends AbstractMutableFloatMatrixRel<DurationUnit, FloatDurationMatrix, MutableFloatDurationMatrix, FloatDuration>
21 {
22
23 private static final long serialVersionUID = 20151006L;
24
25
26
27
28
29
30
31
32 public MutableFloatDurationMatrix(final float[][] values, final DurationUnit unit, final StorageType storageType)
33 throws ValueException
34 {
35 super(values, unit, storageType);
36 }
37
38
39
40
41
42
43
44 public MutableFloatDurationMatrix(final FloatDuration[][] values, final StorageType storageType) throws ValueException
45 {
46 super(values, storageType);
47 }
48
49
50
51
52
53
54 MutableFloatDurationMatrix(final FloatMatrixData data, final DurationUnit unit)
55 {
56 super(data, unit);
57 }
58
59
60 @Override
61 protected final FloatDurationMatrix instantiateType(final FloatMatrixData fmd, final DurationUnit unit)
62 {
63 return new FloatDurationMatrix(fmd, unit);
64 }
65
66
67 @Override
68 public final MutableFloatDurationMatrix toDense()
69 {
70 return this.data.isDense() ? this : instantiateMutableType(this.data.toDense(), getUnit());
71 }
72
73
74 @Override
75 public final MutableFloatDurationMatrix toSparse()
76 {
77 return this.data.isSparse() ? this : instantiateMutableType(this.data.toSparse(), getUnit());
78 }
79
80
81 @Override
82 protected final MutableFloatDurationMatrix instantiateMutableType(final FloatMatrixData fmd, final DurationUnit unit)
83 {
84 return new MutableFloatDurationMatrix(fmd, unit);
85 }
86
87
88 @Override
89 protected final FloatDuration instantiateScalar(final float value, final DurationUnit unit)
90 {
91 return new FloatDuration(value, unit);
92 }
93
94 }