|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.approximatrix.charting.model.AbstractChartDataModel
com.approximatrix.charting.model.DefaultChartDataModel
public class DefaultChartDataModel
Implements a default ChartModel. It uses a DataSet[] and the columns are numeric. It's purely read-only.
| Field Summary | |
|---|---|
protected java.util.TreeSet |
columnSet
The sorted x-axis values used for calculating the constraints. |
protected ChartDataModelConstraints |
constraints1
The constraints for the first and second y-axes. |
protected ChartDataModelConstraints |
constraints2
The constraints for the first and second y-axes. |
protected java.util.ArrayList |
data
The DataSet list. |
protected java.util.HashMap |
valuesbyaxis
A HashMap containing the ordered data used for calculating the constraints. |
| Fields inherited from class com.approximatrix.charting.model.AbstractChartDataModel |
|---|
autoscale, listener, manualscale, maxcolumn, maxvalue, mincolumn, minvalue |
| Constructor Summary | |
|---|---|
DefaultChartDataModel()
Creates a new empty DefaultChartDataModel. |
|
DefaultChartDataModel(DataSet[] ds)
Creates a new DefaultChartDataModel using the given array of DataSets, effectively enabling the creation of DataModels with differently sized DataSets. |
|
DefaultChartDataModel(double[][] data,
double[] columns,
java.lang.String[] rows)
Creates new DefaultChartDataModel. |
|
DefaultChartDataModel(int[][] data,
double[] columns,
java.lang.String[] rows)
Creates new DefaultChartDataModel. |
|
DefaultChartDataModel(java.lang.Number[][] data,
double[] columns,
java.lang.String[] rows)
Creates new DefaultChartDataModel with the default axis binding. |
|
| Method Summary | |
|---|---|
int |
getAxisBinding(int set)
Returns the axis binding for a DataSet |
ChartDataModelConstraints |
getChartDataModelConstraints(int axis)
Returns a ChartDataModelConstraints Object for a given axis. |
java.lang.Class |
getColumnClass()
Returns the class of the column values. |
java.lang.Object |
getColumnValueAt(int col)
Use getColumnValue(int set, int col) instead, because DefaultChartDataModel can contain DataSets with different lengths and column values. |
java.lang.Object |
getColumnValueAt(int set,
int col)
Returns a specific column value. |
int |
getDataSetLength(int set)
Returns the length of a certain dataset. |
java.lang.String |
getDataSetName(int set)
Returns the title of the DataSet. |
int |
getDataSetNumber()
Returns the total amount of datasets. |
protected double |
getFirstColumnValue()
Returns the first ordered column value for use by the ChartDataModelConstraints. |
protected double |
getLastColumnValue()
Returns the last ordered column value for use by the ChartDataModelConstraints. |
protected java.util.TreeSet |
getOrderedValues(int axis)
Returns an ordered set of all data values for the specified axis. |
java.lang.Number |
getValueAt(int set,
int index)
Returns the Value in a specific dataset at a certain index. |
boolean |
isColumnNumeric()
Returns true if the columns are numeric. |
void |
setChartDataModelConstraints(int axis,
ChartDataModelConstraints constraints)
Sets the ChartDataModelConstraints object for the given axis binding. |
protected void |
trimSet(java.util.TreeSet s)
Removes infinite and NaN values from a TreeSet. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.TreeSet columnSet
protected java.util.ArrayList data
protected java.util.HashMap valuesbyaxis
protected ChartDataModelConstraints constraints1
protected ChartDataModelConstraints constraints2
| Constructor Detail |
|---|
public DefaultChartDataModel()
public DefaultChartDataModel(java.lang.Number[][] data,
double[] columns,
java.lang.String[] rows)
data - the array of values. The first index specifies the
datasets, the last one is the value index.columns - the array of x-axis values. The length of the
datasets and the length of the column should be equal and the columns should
be ordered.rows - the array of DataSet titles. It has to have the same
length as the number of DataSets.
public DefaultChartDataModel(int[][] data,
double[] columns,
java.lang.String[] rows)
data - the array of values. The first index specifies the
datasets, the last one is the value index.columns - the array of x-axis values. The length of the
datasets and the length of the column should be equal and
the columns should be ordered.rows - the array of DataSet titles. It has to have the same
length as the number of DataSets.
public DefaultChartDataModel(double[][] data,
double[] columns,
java.lang.String[] rows)
data - the array of values. The first index specifies the
datasets, the last one is the value index.columns - the array of x-axis values. The length of the
datasets and the length of the column should be equal and
the columns should be ordered.rows - the array of DataSet titles. It has to have the same
length as the number of DataSets.public DefaultChartDataModel(DataSet[] ds)
ds - the array of DataSets to be used.| Method Detail |
|---|
public int getDataSetLength(int set)
set - the DataSet
public int getDataSetNumber()
public java.lang.String getDataSetName(int set)
getDataSetName in interface ChartDataModelgetDataSetName in class AbstractChartDataModelset - the DataSet index
public int getAxisBinding(int set)
getAxisBinding in interface ChartDataModelgetAxisBinding in class AbstractChartDataModelset - the DataSet index
public boolean isColumnNumeric()
isColumnNumeric in interface ChartDataModelisColumnNumeric in class AbstractChartDataModeltruepublic java.lang.Class getColumnClass()
getColumnClass in interface ChartDataModelgetColumnClass in class AbstractChartDataModelDouble.class
public java.lang.Number getValueAt(int set,
int index)
set - the DataSet indexindex - the value index
public java.lang.Object getColumnValueAt(int col)
col - the column index
public java.lang.Object getColumnValueAt(int set,
int col)
col - the column indexset - the DataSet of which the column value is desired
null if the column doesn't exist.public ChartDataModelConstraints getChartDataModelConstraints(int axis)
axis - the axis constant.
public void setChartDataModelConstraints(int axis,
ChartDataModelConstraints constraints)
axis - the Axis constantconstraints - the ChartDataModelConstraints objectprotected void trimSet(java.util.TreeSet s)
protected java.util.TreeSet getOrderedValues(int axis)
getOrderedValues in class AbstractChartDataModelprotected double getFirstColumnValue()
getFirstColumnValue in class AbstractChartDataModelprotected double getLastColumnValue()
getLastColumnValue in class AbstractChartDataModel
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||