|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jrefinery.data.AbstractDataset | +--com.jrefinery.data.AbstractSeriesDataset | +--com.jrefinery.data.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.
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 | |
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, getGroup, notifyListeners, removeChangeListener, setGroup |
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, getGroup, removeChangeListener, setGroup |
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.
data
- the dataset.public DefaultXYDataset(java.lang.String[] seriesNames, java.lang.Object[][][] data)
seriesNames
- the names of the series.data
- the dataset.public DefaultXYDataset(java.util.List seriesNames, java.lang.Object[][][] data)
seriesNames
- the names of the series.data
- the dataset.Method Detail |
public int getSeriesCount()
getSeriesCount
in interface SeriesDataset
getSeriesCount
in class AbstractSeriesDataset
public int getItemCount(int series)
getItemCount
in interface XYDataset
series
- the index of the series (zero-based).public java.lang.String getSeriesName(int series)
getSeriesName
in interface SeriesDataset
getSeriesName
in class AbstractSeriesDataset
series
- 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 XYDataset
series
- 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 XYDataset
series
- 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: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |