/**
* Returns the primary dataset for the plot.
*
* @return The primary dataset (possibly <code>null</code>).
*
* @see #setDataset(CategoryDataset)
*/
/**
* Returns the primary dataset for the plot.
*
* @return The primary dataset (possibly <code>null</code>).
*/
public [[#variable1a8060e0]] getDataset() {
return getDataset(0);
}
/**
* Returns the dataset at the given index.
*
* @param index the dataset index.
*
* @return The dataset (possibly <code>null</code>).
*
* @see #setDataset(int, CategoryDataset)
*/
/**
* Returns the dataset at the given index.
*
* @param index the dataset index.
*
* @return The dataset (possibly <code>null</code>).
*/
public [[#variable1a8060e0]] getDataset(int index) {
[[#variable1a8060e0]] result = null;
if (this.datasets.size() > index) {
result = ( [[#variable1a8060e0]]) this.datasets.get(index);
}
return result;
}
/**
* Sets the dataset for the plot, replacing the existing dataset, if there
* is one. This method also calls the
* {@link #datasetChanged(DatasetChangeEvent)} method, which adjusts the
* axis ranges if necessary and sends a {@link PlotChangeEvent} to all
* registered listeners.
*
* @param dataset the dataset (<code>null</code> permitted).
*
* @see #getDataset()
*/
/**
* Sets the dataset for the plot, replacing the existing dataset, if there
* is one, and sends a {@link PlotChangeEvent} to all registered
* listeners.
*
* @param dataset the dataset (<code>null</code> permitted).
*/
public void setDataset( [[#variable1a8060e0]] dataset) {
setDataset(0, dataset);
}
/**
* Sets a dataset for the plot.
*
* @param index the dataset index.
* @param dataset the dataset (<code>null</code> permitted).
*
* @see #getDataset(int)
*/
/**
* Sets a dataset for the plot.
*
* @param index the dataset index.
* @param dataset the dataset (<code>null</code> permitted).
*/
public void setDataset(int index, [[#variable1a8060e0]] dataset) {
[[#variable1a8060e0]] existing = ( [[#variable1a8060e0]]) this.datasets.get(index);
if (existing != null) {
existing.removeChangeListener(this );
}
this.datasets.set(index, dataset);
if (dataset != null) {
dataset.addChangeListener(this );
}
// send a dataset change event to self...
DatasetChangeEvent event = new DatasetChangeEvent(this, dataset);
datasetChanged(event);
}
/**
* Returns the number of datasets.
*
* @return The number of datasets.
*
* @since 1.0.2
*/
/**
* Returns the number of datasets.
*
* @return The number of datasets.
*/
public int getDatasetCount() {
return this.datasets.size();
}
|