ucl.physiol.neuroconstruct.dataset
Class DataSet
java.lang.Object
ucl.physiol.neuroconstruct.dataset.DataSet
public class DataSet
- extends Object
Storage for the set of points to be plotted. Basically a wrapper for 2
double arrays for the x and y values. Also contained here is some metadata for
the preferred graph format/colour, some comments associated with the points and
a reference to the file to store the data in.
- Author:
- Padraig Gleeson
|
Field Summary |
static int |
xDim
|
static int |
yDim
|
xDim
public static int xDim
yDim
public static int yDim
DataSet
public DataSet(String refrence,
String description,
String xUnit,
String yUnit,
String xLegend,
String yLegend)
getDataSetFile
public File getDataSetFile()
getPoint
public double[] getPoint(int index)
updateCommentArray
public void updateCommentArray()
setCommentOnPoint
public void setCommentOnPoint(int pointNum,
String comment)
getComment
public String getComment(int pointNum)
getNumberPoints
public int getNumberPoints()
addPoint
public int addPoint(double x,
double y)
- Adds a point and returns the pointNumber
areXvalsStrictlyIncreasing
public boolean areXvalsStrictlyIncreasing()
deletePoint
public void deletePoint(int pointNum)
throws DataSetException
- Throws:
DataSetException
getXSpacing
public double getXSpacing()
throws DataSetException
- Gets the spacing between each X value. If the x values are not a common
distance apart (or if numberValidPoints<2), returns -1
NOTE: Only checks spacings difference < 1/500, so this function should
only be used for graphing purposes
- Throws:
DataSetException
getYvalue
public double getYvalue(double x)
throws ValueNotPresentException
- Throws:
ValueNotPresentException
getXValues
public double[] getXValues()
setXValue
public void setXValue(int pointNum,
double value)
throws DataSetException
- Throws:
DataSetException
setYValue
public void setYValue(int pointNum,
double value)
throws DataSetException
- Throws:
DataSetException
getYValues
public double[] getYValues()
toString
public String toString()
- returns String containing bracketed points, e.g.
[(0, 0), (1, 1), ...]
- Overrides:
toString in class Object
pointToString
public String pointToString(int i)
getMaxX
public double[] getMaxX()
getMinX
public double[] getMinX()
getMaxY
public double[] getMaxY()
getMinY
public double[] getMinY()
getXUnit
public String getXUnit()
getYUnit
public String getYUnit()
setUnits
public void setUnits(String xUnit,
String yUnit)
setXUnit
public void setXUnit(String xUnit)
setYUnit
public void setYUnit(String yUnit)
setXLegend
public void setXLegend(String xLegend)
setYLegend
public void setYLegend(String yLegend)
getXLegend
public String getXLegend()
getYLegend
public String getYLegend()
setLegends
public void setLegends(String xLegend,
String yLegend)
getDescription
public String getDescription()
setDescription
public void setDescription(String description)
getGraphColour
public Color getGraphColour()
setGraphColour
public void setGraphColour(Color graphColour)
getGraphFormat
public String getGraphFormat()
setGraphFormat
public void setGraphFormat(String graphFormat)
getReference
public String getReference()
getSafeReference
public String getSafeReference()
setReference
public void setReference(String reference)
setDataSetFile
public void setDataSetFile(File dataSetFile)
main
public static void main(String[] args)
throws DataSetException
- Throws:
DataSetException