org.jfree.data.xy
Class DefaultXYDataset
- Cloneable, Dataset, EventListener, PublicCloneable, Serializable, Dataset, ObjectInputValidation, Serializable, SeriesChangeListener, SeriesDataset, XYDataset
A default implementation of the
XYDataset interface that stores
data values in arrays of double primitives.
DefaultXYDataset()- Creates a new
DefaultXYDataset instance, initially
containing no data.
|
void | addSeries(Comparable seriesKey, double[][] data)- Adds a series or if a series with the same key already exists replaces
the data for that series, then sends a
DatasetChangeEvent to
all registered listeners.
|
Object | clone()- Creates an independent copy of this dataset.
|
boolean | equals(Object obj)- Tests this
DefaultXYDataset instance for equality with an
arbitrary object.
|
DomainOrder | getDomainOrder()- Returns the order of the domain (x-) values in the dataset.
|
int | getItemCount(int series)- Returns the number of items in the specified series.
|
int | getSeriesCount()- Returns the number of series in the dataset.
|
Comparable | getSeriesKey(int series)- Returns the key for a series.
|
Number | getX(int series, int item)- Returns the x-value for an item within a series.
|
double | getXValue(int series, int item)- Returns the x-value for an item within a series.
|
Number | getY(int series, int item)- Returns the y-value for an item within a series.
|
double | getYValue(int series, int item)- Returns the y-value for an item within a series.
|
int | hashCode()- Returns a hash code for this instance.
|
int | indexOf(Comparable seriesKey)- Returns the index of the series with the specified key, or -1 if there
is no such series in the dataset.
|
void | removeSeries(Comparable seriesKey)- Removes a series from the dataset, then sends a
DatasetChangeEvent to all registered listeners.
|
DefaultXYDataset
public DefaultXYDataset()
Creates a new DefaultXYDataset instance, initially
containing no data.
addSeries
public void addSeries(Comparable seriesKey,
double[][] data) Adds a series or if a series with the same key already exists replaces
the data for that series, then sends a
DatasetChangeEvent to
all registered listeners.
seriesKey - the series key (null not permitted).data - the data (must be an array with length 2, containing two
arrays of equal length, the first containing the x-values and the
second containing the y-values).
clone
public Object clone()
throws CloneNotSupportedException Creates an independent copy of this dataset.
- clone in interface AbstractDataset
equals
public boolean equals(Object obj)
Tests this
DefaultXYDataset instance for equality with an
arbitrary object. This method returns
true if and only if:
obj is not null;obj is an instance of
DefaultXYDataset;- both datasets have the same number of series, each containing
exactly the same values.
obj - the object (null permitted).
getItemCount
public int getItemCount(int series)
Returns the number of items in the specified series.
- getItemCount in interface XYDataset
series - the series index (in the range 0 to
getSeriesCount() - 1).
getX
public Number getX(int series,
int item) Returns the x-value for an item within a series.
- getX in interface XYDataset
series - the series index (in the range 0 to
getSeriesCount() - 1).item - the item index (in the range 0 to
getItemCount(series)).
getXValue
public double getXValue(int series,
int item) Returns the x-value for an item within a series.
- getXValue in interface XYDataset
- getXValue in interface AbstractXYDataset
series - the series index (in the range 0 to
getSeriesCount() - 1).item - the item index (in the range 0 to
getItemCount(series)).
getY
public Number getY(int series,
int item) Returns the y-value for an item within a series.
- getY in interface XYDataset
series - the series index (in the range 0 to
getSeriesCount() - 1).item - the item index (in the range 0 to
getItemCount(series)).
getYValue
public double getYValue(int series,
int item) Returns the y-value for an item within a series.
- getYValue in interface XYDataset
- getYValue in interface AbstractXYDataset
series - the series index (in the range 0 to
getSeriesCount() - 1).item - the item index (in the range 0 to
getItemCount(series)).
hashCode
public int hashCode()
Returns a hash code for this instance.
removeSeries
public void removeSeries(Comparable seriesKey)
Removes a series from the dataset, then sends a
DatasetChangeEvent to all registered listeners.
seriesKey - the series key (null not permitted).