ucl.physiol.neuroconstruct.dataset
Class DataSet

java.lang.Object
  extended by 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
           
 
Constructor Summary
DataSet(String refrence, String description, String xUnit, String yUnit, String xLegend, String yLegend)
           
 
Method Summary
 int addPoint(double x, double y)
          Adds a point and returns the pointNumber
 boolean areXvalsStrictlyIncreasing()
           
 void deletePoint(int pointNum)
           
 String getComment(int pointNum)
           
 File getDataSetFile()
           
 String getDescription()
           
 Color getGraphColour()
           
 String getGraphFormat()
           
 double[] getMaxX()
           
 double[] getMaxY()
           
 double[] getMinX()
           
 double[] getMinY()
           
 int getNumberPoints()
           
 double[] getPoint(int index)
           
 String getReference()
           
 String getSafeReference()
           
 String getXLegend()
           
 double getXSpacing()
          Gets the spacing between each X value.
 String getXUnit()
           
 double[] getXValues()
           
 String getYLegend()
           
 String getYUnit()
           
 double getYvalue(double x)
           
 double[] getYValues()
           
static void main(String[] args)
           
 String pointToString(int i)
           
 void setCommentOnPoint(int pointNum, String comment)
           
 void setDataSetFile(File dataSetFile)
           
 void setDescription(String description)
           
 void setGraphColour(Color graphColour)
           
 void setGraphFormat(String graphFormat)
           
 void setLegends(String xLegend, String yLegend)
           
 void setReference(String reference)
           
 void setUnits(String xUnit, String yUnit)
           
 void setXLegend(String xLegend)
           
 void setXUnit(String xUnit)
           
 void setXValue(int pointNum, double value)
           
 void setYLegend(String yLegend)
           
 void setYUnit(String yUnit)
           
 void setYValue(int pointNum, double value)
           
 String toString()
          returns String containing bracketed points, e.g.
 void updateCommentArray()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

xDim

public static int xDim

yDim

public static int yDim
Constructor Detail

DataSet

public DataSet(String refrence,
               String description,
               String xUnit,
               String yUnit,
               String xLegend,
               String yLegend)
Method Detail

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