1 package org.catacomb.numeric.data;
2
3 import org.catacomb.interlish.reflect.Narrower;
4
5
6
7
8 public class FloatVector extends DataItem {
9
10 double[] value;
11
12
13 public FloatVector(String nm, double[] v) {
14 super(nm);
15 value = v;
16 }
17
18
19 public FloatVector(String nm, String sva) {
20 super(nm);
21 value = Narrower.readDoubleArray(sva);
22 }
23
24
25
26
27
28 public double[] getValue() {
29 return value;
30 }
31
32
33 public int length() {
34 return value.length;
35 }
36
37
38 public String getStringValue() {
39 StringBuffer sb = new StringBuffer();
40 if (value.length > 0) {
41 sb.append(value[0]);
42 }
43 for (int i = 1; i < value.length; i++) {
44 sb.append(", " + value[i]);
45 }
46 return sb.toString();
47 }
48
49
50 public DataItem getMarked() {
51 return this;
52 }
53 }