|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.quinncurtis.chart2djava.ChartObj
com.quinncurtis.chart2djava.ChartDataset
com.quinncurtis.chart2djava.GroupDataset
public class GroupDataset
Group data is a collection of data, where more than one dependent variable, the x's, corresponds to the independent one, the y's. The number of columns in this array must be equal to the number of data points, and the number of rows - to the number of dependent variables or groups.
Field Summary |
---|
Fields inherited from class com.quinncurtis.chart2djava.ChartDataset |
---|
initialCondition, markLookaheadLimit |
Constructor Summary | |
---|---|
GroupDataset()
The default GroupDataset constructor. |
|
GroupDataset(CSV csv,
java.lang.String filename,
int rowskip,
int columnskip)
This constructor creates a new GroupDataset object from a file consisting of comma separated values. |
|
GroupDataset(java.lang.String sname,
double[] x,
double[] y)
This constructor creates a new, group GroupDataset object that uses floating point values. |
|
GroupDataset(java.lang.String sname,
double[] x,
double[][] y)
This constructor creates a new, group GroupDataset object that uses floating point values. |
|
GroupDataset(java.lang.String sname,
double[] x,
double[][] y,
boolean[] valid)
This constructor creates a new, group GroupDataset object that uses floating point values. |
|
GroupDataset(java.lang.String sname,
int nrows,
int ncols)
This constructor creates a new, group GroupDataset object of the specified size. |
Method Summary | |
---|---|
void |
addGroup(double[] y)
This method adds a new row (or group) of y-values to the existing group dataset, increasing the number of groups in the dataset by 1. |
int |
addGroupDataPoints(double x,
double[] y)
This method adds a new xy point to a dataset, increasing its size by one. |
int |
addGroupDataPoints(GroupPoint2D xy)
This method adds a new xy point to a dataset, increasing its size by one. |
boolean |
calcNearestPoint(PhysicalCoordinates transform,
ChartPoint2D testpoint,
int nmode,
NearestPointData nearestpoint)
This method compares a test point against all of the xy points in a simple dataset and calculates which point in the dataset is nearest the test point. |
boolean |
checkValidGroupData(PhysicalCoordinates transform,
int index)
This method checks to see if the x- and y-data values for a given index are valid, taking into account any discontinuities in the coordinate system. |
boolean |
checkValidGroupData(PhysicalCoordinates transform,
int ngroup,
int index)
This method checks to see if the x- and y-data values for a given index are valid, taking into account any discontinuities in the coordinate system. |
boolean |
checkValidGroupDataX(PhysicalCoordinates transform,
int index)
This method checks to see if the x-data value is valid, taking into account any discontinuities in the coordinate system. |
boolean |
checkValidGroupDataY(PhysicalCoordinates transform,
int ngroup,
int index)
This method checks to see if the y-data value is valid, taking into account any discontinuities in the coordinate system. |
java.lang.Object |
clone()
Returns an object that is a clone of this GroupDataset object. |
GroupDataset |
CompressGroupDataset(int ctypex,
int[] ctypey,
int interval,
int startindex,
int endindex,
java.lang.String newname)
This methods creates and returns a new dataset that is the data reduced version of the source dataset. |
GroupDataset |
CompressGroupDataset(int ctypex,
int ctypey,
int interval,
int startindex,
int endindex,
java.lang.String newname)
This methods creates and returns a new dataset that is the data reduced version of the source dataset. |
void |
copy(GroupDataset source)
Copies the source group dataset. |
int |
deleteGroup(int deletegroup)
Deletes the specified group in the dataset, decreasing the numGroups field by one. |
int |
deleteGroupDataPoints(int deletepoint)
Deletes a data point at the specified location, decreasing the size of the dataset by one. |
int |
errorCheck(int nerror)
Checks the current group dataset object for common errors. |
int |
FindNearestGroup(int index,
double findvalue)
This method finds the nearest group data value nearest a test value. |
int |
getAutoScaleNumberGroups()
This method returns the value of the number of groups used in auto axis calculations. |
ChartPoint2D |
getDataPoint(int ngroup,
int index)
This method returns the x- and y-value of a point in a group dataset. |
double[] |
getDatasetColumnSum()
This method returns an array of double that contains the sum of the group values for each index, 0 to numberDatapoints-1. |
double |
getDatasetMax(int naxis)
This method returns the maximum value for either the xData or yData arrays. |
double |
getDatasetMin(int naxis)
This method returns the minimum value for either the xData or yData arrays. |
GroupDataset |
getFastClipDataset(java.lang.String s,
PhysicalCoordinates transform,
int fastclipmode,
java.lang.Integer fastclipoffset)
This method returns a truncated dataset that only includes the datapoints within the current scaling limits, assuming the the data is monotonic in the x or y direction. |
int |
getFirstValidIndex(int ngroup)
This method returns the index of the first valid data point in a group dataset. |
double |
getGroupAverageY(int ngroup)
This method returns the average for the y-values of a specific group in a group dataset. |
double[][] |
getGroupData()
This method returns a reference to the yGroupData array, the array of y-values for group datasets. |
double[] |
getGroupDataColumn(int ncolumn)
This method gets the y-values associated with a group dataset column index. |
DoubleArray2D |
getGroupDataObj()
This method returns a reference to the internal DoubleArray2D object used to store the group y-values. |
double[] |
getGroupDataRow(int nrow)
This method gets the y-values associated with a group dataset row index. |
DoubleArray |
getGroupDatasetColumnSum()
This method returns an array of double, that contains the sum of the group values for each index, 0 to numberDatapoints-1. |
double |
getGroupDatasetMax(int naxis)
This method returns the maximum value for either the xData or yGroupData arrays. |
double |
getGroupDatasetMin(int naxis)
This method returns the minimum value for either the xData or arrays. |
double |
getGroupDatasetSumMax(int naxis)
This method returns the maximum value for either the xData array, or the maximum of the sum across groups for each index of the yGroupData array. |
double |
getGroupDatasetSumMin(int naxis)
This method returns the minimum value for either the xData array, or the minimum of value in group #0 of the yGroupData array. |
double |
getGroupSumY(int ngroup)
This method returns the sum for the y-values of a specific group in a group dataset. |
int |
getNumberGroups()
This method returns the value of the numberGroups field which is number of groups in a group dataset. |
SimpleDataset |
getSimpleDataset(java.lang.String sname,
int group)
This methods creates a new, SimpleDataset object using the x-values and the y-values of the specified group. |
double[][] |
getYData()
This method returns a reference to the yGroupData array, the array of y-values for group datasets. |
DoubleArray2D |
getYDataObj()
This method returns a reference to the internal DoubleArray2D object used to store the group y-values. |
double |
getYDataValue(int ngroup,
int index)
This method resolves the generalized getYDataValue method int the abstract ChartDataset class. |
double |
getYGroupDataValue(int ngroup,
int index)
This method returns a y-value in a group dataset. |
void |
initDataset(java.lang.String sname,
double[] x,
double[][] y)
An initialization method that initializes the name, and the x- and y-values of a group dataset that uses floating point values. |
void |
initializeData(double[] x,
double[][] y)
An initialization method that initializes the x- and y-values of a group dataset that uses floating point values. |
int |
insertGroupDataPoints(double xvalue,
double[] yvalue,
int insertpoint)
Insert a data point at the specified location, increasing the size of the dataset by one. |
int |
insertGroupDataPoints(GroupPoint2D xyvalue,
int insertpoint)
Insert a data point at the specified location, increasing the size of the dataset by one. |
boolean |
isDataPointGood(int index)
This method checks if the point at the specified index for a simple dataset is valid. |
boolean |
isDataPointGood(int ngroup,
int index)
This method checks if the point at the specified index and group number for a group dataset is valid. |
void |
readGroupDataset(CSV csv,
java.lang.String filename,
int rowskip,
int columnskip)
This methods will open a text file and read the CSV (Comma Separated Value) formatted data values in that file. |
void |
readGroupDatasetAsResource(CSV csv,
java.io.BufferedReader pReader,
int rowskip,
int columnskip)
This methods will open a text file and read the CSV (Comma Separated Value) formatted data values in that file. |
void |
resize(int n)
Resizes the dataset, maintaining the original data. |
void |
setAutoScaleNumberGroups(int autoscalenumgroups)
Sets the value of the number of groups used in auto axis calculations. |
void |
setDataPoint(int index,
ChartPoint2D p,
int ngroup)
Sets the x- and y-values for a data point in a group dataset. |
void |
setDataPoint(int index,
double x,
double y,
int ngroup)
Sets the x- and y-values for a data point in a group dataset. |
void |
setGroupData(double[][] ygroup)
This method sets the values of the yGroupData array, the array of group y-values for group datasets. |
void |
setGroupDataColumn(double[] y,
int ncolumn)
Sets the y-values associated with a group dataset column index. |
void |
setGroupDataColumn(double x,
double[] y,
int ncolumn)
Sets the x- and y-values associated with a group dataset column index. |
void |
setGroupDataElement(double y,
int nrow,
int ncolumn)
Sets the y-value at a specific row and column of a group dataset. |
void |
setGroupDataRow(double[] y,
int nrow)
Sets the y-values associated with a group dataset row index. |
void |
setYDataValue(int ngroup,
int index,
double y)
This method resolves the generalized setYDataValue method int the abstract ChartDataset class. |
void |
setYGroupDataValue(int ngroup,
int index,
double y)
Sets the y-value in a group dataset. |
void |
sortByX(boolean ascending)
This method sorts the group dataset according to the x-values. |
void |
writeGroupDataset(CSV csv,
java.lang.String filename)
This methods will create a text file and output the dataset to that file in a CSV (Comma Separated Value) format. |
void |
writeGroupDataset(CSV csv,
java.lang.String filename,
boolean append)
This methods will create a text file and output the dataset to that file in a CSV (Comma Separated Value) format. |
Methods inherited from class com.quinncurtis.chart2djava.ChartObj |
---|
copy, getChartObjIDCntr, getChartObjType, getThisChartObjID, TypeSafeVectorCopy |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GroupDataset()
public GroupDataset(CSV csv, java.lang.String filename, int rowskip, int columnskip)
csv
- An instance of an CSV object.filename
- The name of the file.rowskip
- Skip this many rows before starting the read operation.columnskip
- For each row of data, skip this many columns before reading the first value from the row.public GroupDataset(java.lang.String sname, double[] x, double[] y)
sname
- Specifies the name of the dataset.x
- An array that specifies the x-values of a group dataset.y
- An array that specifies the y-values of a group dataset.public GroupDataset(java.lang.String sname, double[] x, double[][] y)
sname
- Specifies the name of the dataset.x
- An array that specifies the x-values of a group dataset.y
- An array that specifies the y-values of a group dataset.public GroupDataset(java.lang.String sname, double[] x, double[][] y, boolean[] valid)
sname
- Specifies the name of the dataset.x
- An array that specifies the x-values of a group dataset.y
- An array that specifies the y-values of a group dataset.valid
- An array that specifies the valid values of a dataset.public GroupDataset(java.lang.String sname, int nrows, int ncols)
sname
- Specifies the name of the dataset.nrows
- Number of rows, or groups in the dataset.ncols
- Number of columns, or numDatapoints in the dataset.Method Detail |
---|
public void addGroup(double[] y)
y
- An array that specifies the y-values for a new group of a group dataset.public int addGroupDataPoints(double x, double[] y)
x
- Specifies the new x-value for the data point.y
- An array that holds the y-values to add.
public int addGroupDataPoints(GroupPoint2D xy)
xy
- Specifies the new x-value and y-values for the data point7.
public boolean calcNearestPoint(PhysicalCoordinates transform, ChartPoint2D testpoint, int nmode, NearestPointData nearestpoint)
calcNearestPoint
in class ChartDataset
transform
- The PhysicalCoordinates coordinate system associated with these points.testpoint
- The test point for the nearness calculation.nmode
- Specifies the algorithm used in the nearness calculation.nearestpoint
- Returns the parameters of the nearest point.
public boolean checkValidGroupData(PhysicalCoordinates transform, int index)
transform
- Specifies the coordinate system being used to plot the data.index
- Specifies the index to check in the group data arrays.
public boolean checkValidGroupData(PhysicalCoordinates transform, int ngroup, int index)
transform
- Specifies the coordinate system being used to plot the data.index
- Specifies the index to check in the group data arrays.ngroup
- Specifies the group number to check in the yGroupData array.
public boolean checkValidGroupDataX(PhysicalCoordinates transform, int index)
transform
- Specifies the coordinate system being used to plot the data.index
- Specifies the index to check in the xData array.
public boolean checkValidGroupDataY(PhysicalCoordinates transform, int ngroup, int index)
transform
- Specifies the coordinate system being used to plot the data.index
- Specifies the index to check in the yData array.ngroup
- Specifies the group number to check in the yGroupData array.
public java.lang.Object clone()
clone
in class java.lang.Object
public GroupDataset CompressGroupDataset(int ctypex, int[] ctypey, int interval, int startindex, int endindex, java.lang.String newname)
ctypex
- The compression type. Use one of the data compression type constants:
DATACOMPRESS_NONE (returns a dataset containing the points in the specified range, no compression),
DATACOMPRESS_SKIP (sample the dataset every interval points), DATACOMPRESS_AVERAGE (use the average x- and
y-value in each interval), DATACOMPRESS_MIN (use the minimum x- and y-value in each interval),
DATACOMPRESS_MAX (use the maximum x- and y-value in each interval), and DATACOMPRESS_MINMAX (use the
minimum and maximum x- and y-value in each interval). The DATACOMPRESS_MINMAX compression type is best
used when the compressed data values number more than 1000, where adjacent data values in the rendered
chart differ by one horizontal pixel or less. The DATACOMPRESS_MINMAX compression type will guarantee that
the chart displays the same minimums and maximums as the original dataset.ctypey
- An array of compression types for the y-values, one for each group. Use one of the
data compression type constants.interval
- The number of data points in each segment that is reduced to a single
datapoint (two for the DATACOMPRESS_MINMAX compression type) in the compressed dataset.startindex
- The starting point, inclusive, in the source dataset for the data compression.endindex
- The ending index, inclusive, in the source dataset for the data compression.newname
- The string name for the new dataset.
public GroupDataset CompressGroupDataset(int ctypex, int ctypey, int interval, int startindex, int endindex, java.lang.String newname)
ctypex
- The compression type. Use one of the data compression type constants:
DATACOMPRESS_NONE (returns a dataset containing the points in the specified range, no compression),
DATACOMPRESS_SKIP (sample the dataset every interval points), DATACOMPRESS_AVERAGE (use the average
x- and y-value in each interval), DATACOMPRESS_MIN (use the minimum x- and y-value in each interval),
DATACOMPRESS_MAX (use the maximum x- and y-value in each interval), and DATACOMPRESS_MINMAX
(use the minimum and maximum x- and y-value in each interval).ctypey
- The compression type for the y-values. Use one of the he data compression type constants.interval
- The number of data points in each segment that is reduced to a single
datapoint (two for the DATACOMPRESS_MINMAX compression type) in the compressed dataset.startindex
- The starting point, inclusive, in the source dataset for the data compression.endindex
- The ending index, inclusive, in the source dataset for the data compression.newname
- The string name for the new dataset.
public void copy(GroupDataset source)
source
- The source group dataset object.public int deleteGroup(int deletegroup)
deletegroup
- The delete point. Zero based array indexing is used, so the 5th data point
in the array has an index value of 4.
public int deleteGroupDataPoints(int deletepoint)
deletepoint
- The delete point. Zero based array indexing is used, so the 5th data point
in the array has an index value of 4.
public int errorCheck(int nerror)
errorCheck
in class ChartDataset
nerror
- Current error state
public int FindNearestGroup(int index, double findvalue)
index
- Specifies the data point index of the group values.findvalue
- Specifies the test value.
public int getAutoScaleNumberGroups()
public ChartPoint2D getDataPoint(int ngroup, int index)
ngroup
- Specifies the group number of the data point.index
- Specifies the index of the data point.
public double[] getDatasetColumnSum()
public double getDatasetMax(int naxis)
getDatasetMax
in class ChartDataset
naxis
- Specifies which data array to return the maximum value from. UseX_AXIS for the
xData array, andY_AXIS for yData array.
public double getDatasetMin(int naxis)
getDatasetMin
in class ChartDataset
naxis
- Specifies which data array to return the minimum value from. UseX_AXIS for the xData
array, andY_AXIS for yData array.
public GroupDataset getFastClipDataset(java.lang.String s, PhysicalCoordinates transform, int fastclipmode, java.lang.Integer fastclipoffset)
s
- A string specifying the new name of the dataset.transform
- The transform that the dataset is clipped against.fastclipmode
- Specifies if the data is clipped against the x-coordinate (FASTCLIP_Y),
or the y-coordinate (FASTCLIP_Y).fastclipoffset
- Returns the start offset of the fast clip data.
public int getFirstValidIndex(int ngroup)
ngroup
- Specifies the group number of the dataset that is to be checked.
public double getGroupAverageY(int ngroup)
ngroup
- Specifies the group number of the dataset.
public double[][] getGroupData()
public double[] getGroupDataColumn(int ncolumn)
ncolumn
- Specifies the column index for the data values.
public DoubleArray2D getGroupDataObj()
public double[] getGroupDataRow(int nrow)
nrow
- Specifies the row index for the data values.
public DoubleArray getGroupDatasetColumnSum()
public double getGroupDatasetMax(int naxis)
naxis
- Specifies which data array to return the maximum value from. UseX_AXIS for the
xData array, andY_AXIS for the yGroupData array.
public double getGroupDatasetMin(int naxis)
naxis
- Specifies which data array to return the minimum value from. UseX_AXIS for the
xData array, andY_AXIS for the yGroupData array.
public double getGroupDatasetSumMax(int naxis)
getGroupDatasetSumMax
in class ChartDataset
naxis
- Specifies which data array to return the maximum value from. UseX_AXIS for the xData
array, andY_AXIS for the yGroupData array.
public double getGroupDatasetSumMin(int naxis)
getGroupDatasetSumMin
in class ChartDataset
naxis
- Specifies which data array to return the minimum value from. UseX_AXIS for the xData
array, andY_AXIS for the yGroupData array.
public double getGroupSumY(int ngroup)
ngroup
- Specifies the group number of the dataset.
public int getNumberGroups()
getNumberGroups
in class ChartDataset
public SimpleDataset getSimpleDataset(java.lang.String sname, int group)
sname
- Specifies the name of the dataset.group
- Specifies the y-values to include in the new SimpleDataset.public double[][] getYData()
public DoubleArray2D getYDataObj()
public double getYDataValue(int ngroup, int index)
getYDataValue
in class ChartDataset
ngroup
- Specifies the group of the y-value.index
- Specifies the index of the y-value.
public double getYGroupDataValue(int ngroup, int index)
ngroup
- Specifies the group number of the data value.index
- Specifies the index of the data value.
public void initDataset(java.lang.String sname, double[] x, double[][] y)
sname
- Specifies the name of the dataset.x
- An array that specifies the x-values of a group dataset.y
- An array that specifies the y-values of a group dataset.public void initializeData(double[] x, double[][] y)
x
- An array that specifies the x-values of a group dataset.y
- An array that specifies the y-values of a group dataset.public int insertGroupDataPoints(double xvalue, double[] yvalue, int insertpoint)
xvalue
- The x-value of the new data point to insert.yvalue
- An array, size [numberGroups], of the y-values of the data points to insertinsertpoint
- The insertion point of the data. Zero based array indexing is used, so the 5th
data point in the array has an index value of 4.
public int insertGroupDataPoints(GroupPoint2D xyvalue, int insertpoint)
xyvalue
- The x-value and y-values of the new data point to insert.insertpoint
- The insertion point of the data. Zero based array indexing is used, so the
5th data point in the array has an index value of 4.
public boolean isDataPointGood(int index)
isDataPointGood
in class ChartDataset
index
- Specifies the index to check in the xData and yData arrays.
public boolean isDataPointGood(int ngroup, int index)
ngroup
- Specifies the group number to check in the xData and yGroupData arrays.index
- Specifies the index to check in the xData and yGroupData arrays.
public void readGroupDataset(CSV csv, java.lang.String filename, int rowskip, int columnskip)
csv
- An instance of an CSV object.filename
- The name of the file.rowskip
- Skip this many rows before starting the read operationcolumnskip
- For each new row, skip this many columns before starting read.public void readGroupDatasetAsResource(CSV csv, java.io.BufferedReader pReader, int rowskip, int columnskip)
csv
- An instance of an CSV object.pReader
- A BufferedReader data stream. Must support BufferedReader mark and reset methods.rowskip
- Skip this many rows before starting the read operationcolumnskip
- For each new row, skip this many columns before starting read.public void resize(int n)
n
- The new size of the dataset.public void setAutoScaleNumberGroups(int autoscalenumgroups)
autoscalenumgroups
- Sets the value of the autoScaleNumberGroups field.public void setDataPoint(int index, ChartPoint2D p, int ngroup)
p
- Specifies the new x- and y-values for the data point at the specified index and group.ngroup
- Specifies the group number for the new data values.index
- Specifies the index for the new data values.public void setDataPoint(int index, double x, double y, int ngroup)
index
- Specifies the index for the new data values.x
- Specifies the new x-value for the data point at the specified index and group.y
- Specifies the new y-value for the data point at the specified index and group.ngroup
- Specifies the group number for the new data values.public void setGroupData(double[][] ygroup)
ygroup
- the new y-values.public void setGroupDataColumn(double[] y, int ncolumn)
y
- An array, size [numberGroups], the new y-values for the group dataset at specified
column index.ncolumn
- Specifies the column index for the new data values.public void setGroupDataColumn(double x, double[] y, int ncolumn)
x
- Specifies the new x-value for the data point at the specified column index.y
- An array, size [numberGroups], that specifies the new y-values for the group dataset
at the specified column index.ncolumn
- Specifies the column index for the new data values.public void setGroupDataElement(double y, int nrow, int ncolumn)
y
- The new y-value for a group data value at the specific row and column.nrow
- Specifies the row index for the new data value.ncolumn
- Specifies the column index for the new data value.public void setGroupDataRow(double[] y, int nrow)
y
- An array, size [numberDatapoints], the new y-values for the group dataset at specified
row index.nrow
- Specifies the row index for the new data values.public void setYDataValue(int ngroup, int index, double y)
setYDataValue
in class ChartDataset
y
- Specifies the new y-value for the data point at the specified index and group.ngroup
- Specifies the group for the new data value.index
- Specifies the index for the new data value.public void setYGroupDataValue(int ngroup, int index, double y)
y
- Specifies the new y-value for the data point at the specified index and group.ngroup
- Specifies the group number for the new data value.index
- Specifies the index for the new data value.public void sortByX(boolean ascending)
ascending
- If true, the group dataset is sorted in an ascending order, by x-value.
Otherwise it is sorted in descending order.public void writeGroupDataset(CSV csv, java.lang.String filename)
csv
- An instance of an CSV object.filename
- The name of the file.public void writeGroupDataset(CSV csv, java.lang.String filename, boolean append)
csv
- An instance of an CSV object.filename
- The name of the file.append
- True and if the file exists, data is appended to the file.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |