1 package org.catacomb.numeric.data; 2 3 4 public class FloatScalar extends DataItem { 5 6 double value; 7 8 9 public FloatScalar(String nm, String sv) { 10 super(nm); 11 value = (new Double(sv)).doubleValue(); 12 } 13 14 15 public FloatScalar(String nm, double v) { 16 super(nm); 17 name = nm; 18 value = v; 19 } 20 21 22 public FloatScalar(FloatVector fv) { 23 super(fv.getName()); 24 double[] va = fv.getValue(); 25 if (va.length > 0) { 26 value = va[0]; 27 } else { 28 value = 0.; 29 } 30 } 31 32 33 public double getValue() { 34 return value; 35 } 36 37 38 public DataItem getMarked() { 39 return this; 40 } 41 }