com.approximatrix.charting.model
Class MultiScatterDataModel.DataSet

java.lang.Object
  extended by com.approximatrix.charting.model.MultiScatterDataModel.DataSet
Enclosing class:
MultiScatterDataModel

private class MultiScatterDataModel.DataSet
extends java.lang.Object

Implements a complete data set model that holds and manages X and Y values separately

Author:
armstrong

Field Summary
private  java.util.ArrayList<java.lang.Double> xvalues
          The data set's independent values
private  java.util.ArrayList<java.lang.Double> yvalues
          The data set's dependent values
 
Constructor Summary
MultiScatterDataModel.DataSet()
          Initializes internal ArrayLists without setting any data
MultiScatterDataModel.DataSet(double[][] xy)
          Creates a new data set from a single array containing both x and y values
MultiScatterDataModel.DataSet(double[] x, double[] y)
          Creates a new data set from two vectors containing x and y values
 
Method Summary
 double getMaxX()
          Returns the largest independent value in the data set
 double getMaxY()
          Returns the largest dependent value in the data set
 double getMinX()
          Returns the smallest independent value in the data set
 double getMinY()
          Returns the smallest dependent value in the data set
 double getX(int i)
          Returns the specified independent value
 double getY(int i)
          Returns the specified dependent value
 void setXValue(double value, int i)
          Sets a single independent value at a specified location
 void setXValues(double[] inputs)
          Sets the independent values for this data set
 void setXYValues(double[][] inputs)
          Sets the independent and dependent values simultaneously
 void setYValue(double value, int i)
          Sets a single dependent value at a specified location
 void setYValues(double[] inputs)
          Sets the dependent values for this data set
 int size()
          Returns the number of entries in the data set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xvalues

private java.util.ArrayList<java.lang.Double> xvalues
The data set's independent values


yvalues

private java.util.ArrayList<java.lang.Double> yvalues
The data set's dependent values

Constructor Detail

MultiScatterDataModel.DataSet

public MultiScatterDataModel.DataSet()
Initializes internal ArrayLists without setting any data


MultiScatterDataModel.DataSet

public MultiScatterDataModel.DataSet(double[] x,
                                     double[] y)
Creates a new data set from two vectors containing x and y values

Parameters:
x - the independent values
y - the dependent values

MultiScatterDataModel.DataSet

public MultiScatterDataModel.DataSet(double[][] xy)
Creates a new data set from a single array containing both x and y values

Parameters:
xy - a 2 column array with the first column containing independent values, and the second containing dependent values
Method Detail

size

public int size()
Returns the number of entries in the data set

Returns:
the number of entries

getX

public double getX(int i)
Returns the specified independent value

Parameters:
i - the independent value to retrieve
Returns:
the independent value at i

getY

public double getY(int i)
Returns the specified dependent value

Parameters:
i - the dependent value to retrieve
Returns:
the dependent value at i

setXValues

public void setXValues(double[] inputs)
Sets the independent values for this data set

Parameters:
inputs - a vector of independent values

setYValues

public void setYValues(double[] inputs)
Sets the dependent values for this data set

Parameters:
inputs - a vector of dependent values

setXYValues

public void setXYValues(double[][] inputs)
Sets the independent and dependent values simultaneously

Parameters:
inputs - an array containing independent values in the first column and dependent values in the second column

setXValue

public void setXValue(double value,
                      int i)
Sets a single independent value at a specified location

Parameters:
value - the value to set
i - the location to set

setYValue

public void setYValue(double value,
                      int i)
Sets a single dependent value at a specified location

Parameters:
value - the value to set
i - the location to set

getMaxX

public double getMaxX()
Returns the largest independent value in the data set

Returns:
a double representing the largest indepedent value

getMaxY

public double getMaxY()
Returns the largest dependent value in the data set

Returns:
a double representing the largest depedent value

getMinX

public double getMinX()
Returns the smallest independent value in the data set

Returns:
a double representing the smallest indepedent value

getMinY

public double getMinY()
Returns the smallest dependent value in the data set

Returns:
a double representing the smallest depedent value