1 package tim.prune.function.charts;
4 * Class to hold a data series for the charts
6 public class ChartSeries
8 /** Array of booleans, true for data existing, false otherwise */
9 private boolean[] _hasData = null;
11 private double[] _data = null;
15 * @param inNumPoints number of points
17 public ChartSeries(int inNumPoints)
19 _hasData = new boolean[inNumPoints];
20 _data = new double[inNumPoints];
24 * @param inIndex index of point
25 * @return true if series has data for this point
27 public boolean hasData(int inIndex)
29 return _hasData[inIndex];
33 * @param inIndex index of point
34 * @return data value for this point
36 public double getData(int inIndex)
38 return _data[inIndex];
42 * Set the data at the given index
43 * @param inIndex index of point
44 * @param inData data value
46 public void setData(int inIndex, double inData)
48 _hasData[inIndex] = true;
49 _data[inIndex] = inData;