1 package org.djunits.value.vfloat.vector;
2
3 import java.util.List;
4 import java.util.SortedMap;
5
6 import org.djunits.unit.AngleUnit;
7 import org.djunits.value.StorageType;
8 import org.djunits.value.ValueException;
9 import org.djunits.value.vfloat.scalar.FloatAngle;
10
11
12
13
14
15
16
17
18
19
20
21
22 public class FloatAngleVector extends AbstractFloatVectorRel<AngleUnit, FloatAngleVector, MutableFloatAngleVector, FloatAngle>
23 {
24
25 private static final long serialVersionUID = 20151006L;
26
27
28
29
30
31
32
33
34 public FloatAngleVector(final float[] values, final AngleUnit unit, final StorageType storageType) throws ValueException
35 {
36 super(values, unit, storageType);
37 }
38
39
40
41
42
43
44
45
46 public FloatAngleVector(final List<Float> values, final AngleUnit unit, final StorageType storageType) throws ValueException
47 {
48 super(values, unit, storageType);
49 }
50
51
52
53
54
55
56
57 public FloatAngleVector(final FloatAngle[] values, final StorageType storageType) throws ValueException
58 {
59 super(values, storageType);
60 }
61
62
63
64
65
66
67
68 public FloatAngleVector(final List<FloatAngle> values, final StorageType storageType) throws ValueException
69 {
70 super(values, storageType);
71 }
72
73
74
75
76
77
78
79
80 public FloatAngleVector(final SortedMap<Integer, FloatAngle> values, final int length, final StorageType storageType)
81 throws ValueException
82 {
83 super(values, length, storageType);
84 }
85
86
87
88
89
90
91
92
93
94 public FloatAngleVector(final SortedMap<Integer, Float> values, final AngleUnit unit, final int length,
95 final StorageType storageType) throws ValueException
96 {
97 super(values, unit, length, storageType);
98 }
99
100
101
102
103
104
105 FloatAngleVector(final FloatVectorData data, final AngleUnit unit)
106 {
107 super(data, unit);
108 }
109
110
111 @Override
112 protected final FloatAngleVector instantiateType(final FloatVectorData dvd, final AngleUnit unit)
113 {
114 return new FloatAngleVector(dvd, unit);
115 }
116
117
118 @Override
119 protected final MutableFloatAngleVector instantiateMutableType(final FloatVectorData dvd, final AngleUnit unit)
120 {
121 return new MutableFloatAngleVector(dvd, unit);
122 }
123
124
125 @Override
126 protected final FloatAngle instantiateScalar(final float value, final AngleUnit unit)
127 {
128 return new FloatAngle(value, unit);
129 }
130
131
132 @Override
133 public final FloatAngleVector toDense()
134 {
135 return this.data.isDense() ? (FloatAngleVector) this : instantiateType(this.data.toDense(), getUnit());
136 }
137
138
139 @Override
140 public final FloatAngleVector toSparse()
141 {
142 return this.data.isSparse() ? (FloatAngleVector) this : instantiateType(this.data.toSparse(), getUnit());
143 }
144
145
146
147
148
149
150 public FloatAngle[] toArray()
151 {
152 FloatAngle[] array = new FloatAngle[size()];
153 for (int i = 0; i < size(); i++)
154 {
155 try
156 {
157 array[i] = get(i);
158 }
159 catch (ValueException exception)
160 {
161 throw new RuntimeException(exception);
162 }
163 }
164 return array;
165 }
166
167 }