|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.jrefinery.data.AbstractDataset
com.jrefinery.data.AbstractSeriesDataset
com.jrefinery.data.DefaultXYDataset
public class DefaultXYDataset
A convenience class that provides a default implementation of the XYDataset interface. The standard constructor accepts data in a two dimensional array where the first dimension is the series, and the second dimension is the category.
| Field Summary | |
|---|---|
protected java.util.List |
allSeriesData
A list of Lists containing the data for each series. |
protected java.util.List |
seriesNames
A list of series names. |
| Fields inherited from class com.jrefinery.data.AbstractDataset |
|---|
listeners |
| Constructor Summary | |
|---|---|
DefaultXYDataset()
Constructs a new dataset, initially empty. |
|
DefaultXYDataset(java.util.List seriesNames,
java.lang.Object[][][] data)
Constructs a new dataset with the given data. |
|
DefaultXYDataset(java.lang.Object[][][] data)
Constructs a new dataset, and populates it with the given data. |
|
DefaultXYDataset(java.lang.String[] seriesNames,
java.lang.Object[][][] data)
Constructs a new dataset with the given data. |
|
| Method Summary | |
|---|---|
void |
addXYData(int series,
java.lang.Object xObject,
java.lang.Object yObject)
The following method adds to the list |
int |
getItemCount(int series)
Returns the number of items in the specified series. |
int |
getSeriesCount()
Returns the number of series. |
java.lang.String |
getSeriesName(int series)
Returns the name of the specified series. |
java.lang.Number |
getXValue(int series,
int item)
Returns the x value for the specified series and index (zero-based indices). |
java.lang.Number |
getYValue(int series,
int item)
Returns the y value for the specified series and index (zero-based indices). |
static java.util.List |
seriesNameListFromDataArray(java.lang.Object[][] data)
Returns a List of String objects that can be used as series names. |
void |
setSeriesNames(java.lang.String[] seriesNames)
Sets the names of the series in the data source. |
| Methods inherited from class com.jrefinery.data.AbstractSeriesDataset |
|---|
getLegendItemCount, getLegendItemLabels, seriesChanged |
| Methods inherited from class com.jrefinery.data.AbstractDataset |
|---|
addChangeListener, fireDatasetChanged, notifyListeners, removeChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.jrefinery.data.Dataset |
|---|
addChangeListener, removeChangeListener |
| Field Detail |
|---|
protected java.util.List seriesNames
protected java.util.List allSeriesData
| Constructor Detail |
|---|
public DefaultXYDataset()
public DefaultXYDataset(java.lang.Object[][][] data)
The dimensions of the data array are [series][item][x=0, y=1]. The x-values should be Number or Date objects, the y-values should be Number objects. Any other types are interpreted as zero. The data will be sorted so that the x-values are ascending.
public DefaultXYDataset(java.lang.String[] seriesNames,
java.lang.Object[][][] data)
public DefaultXYDataset(java.util.List seriesNames,
java.lang.Object[][][] data)
| Method Detail |
|---|
public void addXYData(int series,
java.lang.Object xObject,
java.lang.Object yObject)
public int getSeriesCount()
getSeriesCount in interface SeriesDatasetgetSeriesCount in class AbstractSeriesDatasetpublic int getItemCount(int series)
getItemCount in interface XYDatasetseries - The index of the series (zero-based).
public java.lang.String getSeriesName(int series)
getSeriesName in interface SeriesDatasetgetSeriesName in class AbstractSeriesDatasetseries - The index of the required series (zero-based).public void setSeriesNames(java.lang.String[] seriesNames)
seriesNames - The names of the series in the data source.
public java.lang.Number getXValue(int series,
int item)
getXValue in interface XYDatasetseries - The index of the series (zero-based);item - The index of the item (zero-based).
public java.lang.Number getYValue(int series,
int item)
getYValue in interface XYDatasetseries - The index of the series (zero-based);item - The index of the item (zero-based).
public static java.util.List seriesNameListFromDataArray(java.lang.Object[][] data)
data - An array containing the data for the data source.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||