java.lang.Object
org.jfree.data.general.AbstractDataset
org.jfree.data.general.AbstractSeriesDataset
org.jfree.data.xy.AbstractXYDataset
org.jfree.data.xy.AbstractXYZDataset
org.jfree.data.xy.DefaultXYZDataset
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Cloneable,EventListener,PublicCloneable,Dataset,SeriesChangeListener,SeriesDataset,XYDataset,XYZDataset
A default implementation of the
XYZDataset interface that stores
data values in arrays of double primitives.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newDefaultXYZDatasetinstance, initially containing no data. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSeries(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 aDatasetChangeEventto all registered listeners.clone()Creates an independent copy of this dataset.booleanTests thisDefaultXYZDatasetinstance for equality with an arbitrary object.Returns the order of the domain (x-) values in the dataset.intgetItemCount(int series) Returns the number of items in the specified series.intReturns the number of series in the dataset.getSeriesKey(int series) Returns the key for a series.getX(int series, int item) Returns the x-value for an item within a series.doublegetXValue(int series, int item) Returns the x-value for an item within a series.getY(int series, int item) Returns the y-value for an item within a series.doublegetYValue(int series, int item) Returns the y-value for an item within a series.getZ(int series, int item) Returns the z-value for an item within a series.doublegetZValue(int series, int item) Returns the z-value for an item within a series.inthashCode()Returns a hash code for this instance.intindexOf(Comparable seriesKey) Returns the index of the series with the specified key, or -1 if there is no such series in the dataset.voidremoveSeries(Comparable seriesKey) Removes a series from the dataset, then sends aDatasetChangeEventto all registered listeners.Methods inherited from class org.jfree.data.general.AbstractSeriesDataset
seriesChangedMethods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, fireDatasetChanged, getGroup, getNotify, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObjectMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
-
Constructor Details
-
DefaultXYZDataset
public DefaultXYZDataset()Creates a newDefaultXYZDatasetinstance, initially containing no data.
-
-
Method Details
-
getSeriesCount
public int getSeriesCount()Returns the number of series in the dataset.- Specified by:
getSeriesCountin interfaceSeriesDataset- Specified by:
getSeriesCountin classAbstractSeriesDataset- Returns:
- The series count.
-
getSeriesKey
Returns the key for a series.- Specified by:
getSeriesKeyin interfaceSeriesDataset- Specified by:
getSeriesKeyin classAbstractSeriesDataset- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).- Returns:
- The key for the series.
- Throws:
IllegalArgumentException- ifseriesis not in the specified range.
-
indexOf
Returns the index of the series with the specified key, or -1 if there is no such series in the dataset.- Specified by:
indexOfin interfaceSeriesDataset- Overrides:
indexOfin classAbstractSeriesDataset- Parameters:
seriesKey- the series key (nullpermitted).- Returns:
- The index, or -1.
-
getDomainOrder
Returns the order of the domain (x-) values in the dataset. In this implementation, we cannot guarantee that the x-values are ordered, so this method returnsDomainOrder.NONE.- Specified by:
getDomainOrderin interfaceXYDataset- Overrides:
getDomainOrderin classAbstractXYDataset- Returns:
DomainOrder.NONE.
-
getItemCount
public int getItemCount(int series) Returns the number of items in the specified series.- Specified by:
getItemCountin interfaceXYDataset- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).- Returns:
- The item count.
- Throws:
IllegalArgumentException- ifseriesis not in the specified range.
-
getXValue
public double getXValue(int series, int item) Returns the x-value for an item within a series.- Specified by:
getXValuein interfaceXYDataset- Overrides:
getXValuein classAbstractXYDataset- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).item- the item index (in the range0togetItemCount(series)).- Returns:
- The x-value.
- Throws:
ArrayIndexOutOfBoundsException- ifseriesis not within the specified range.ArrayIndexOutOfBoundsException- ifitemis not within the specified range.- See Also:
-
getX
Returns the x-value for an item within a series.- Specified by:
getXin interfaceXYDataset- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).item- the item index (in the range0togetItemCount(series)).- Returns:
- The x-value.
- Throws:
ArrayIndexOutOfBoundsException- ifseriesis not within the specified range.ArrayIndexOutOfBoundsException- ifitemis not within the specified range.- See Also:
-
getYValue
public double getYValue(int series, int item) Returns the y-value for an item within a series.- Specified by:
getYValuein interfaceXYDataset- Overrides:
getYValuein classAbstractXYDataset- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).item- the item index (in the range0togetItemCount(series)).- Returns:
- The y-value.
- Throws:
ArrayIndexOutOfBoundsException- ifseriesis not within the specified range.ArrayIndexOutOfBoundsException- ifitemis not within the specified range.- See Also:
-
getY
Returns the y-value for an item within a series.- Specified by:
getYin interfaceXYDataset- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).item- the item index (in the range0togetItemCount(series)).- Returns:
- The y-value.
- Throws:
ArrayIndexOutOfBoundsException- ifseriesis not within the specified range.ArrayIndexOutOfBoundsException- ifitemis not within the specified range.- See Also:
-
getZValue
public double getZValue(int series, int item) Returns the z-value for an item within a series.- Specified by:
getZValuein interfaceXYZDataset- Overrides:
getZValuein classAbstractXYZDataset- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).item- the item index (in the range0togetItemCount(series)).- Returns:
- The z-value.
- Throws:
ArrayIndexOutOfBoundsException- ifseriesis not within the specified range.ArrayIndexOutOfBoundsException- ifitemis not within the specified range.- See Also:
-
getZ
Returns the z-value for an item within a series.- Specified by:
getZin interfaceXYZDataset- Parameters:
series- the series index (in the range0togetSeriesCount() - 1).item- the item index (in the range0togetItemCount(series)).- Returns:
- The z-value.
- Throws:
ArrayIndexOutOfBoundsException- ifseriesis not within the specified range.ArrayIndexOutOfBoundsException- ifitemis not within the specified range.- See Also:
-
addSeries
Adds a series or if a series with the same key already exists replaces the data for that series, then sends aDatasetChangeEventto all registered listeners.- Parameters:
seriesKey- the series key (nullnot permitted).data- the data (must be an array with length 3, containing three arrays of equal length, the first containing the x-values, the second containing the y-values and the third containing the z-values).
-
removeSeries
Removes a series from the dataset, then sends aDatasetChangeEventto all registered listeners.- Parameters:
seriesKey- the series key (nullnot permitted).
-
equals
Tests thisDefaultXYZDatasetinstance for equality with an arbitrary object. This method returnstrueif and only if:objis notnull;objis an instance ofDefaultXYDataset;- both datasets have the same number of series, each containing exactly the same values.
-
hashCode
public int hashCode()Returns a hash code for this instance. -
clone
Creates an independent copy of this dataset.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classAbstractDataset- Returns:
- The cloned dataset.
- Throws:
CloneNotSupportedException- if there is a problem cloning the dataset (for instance, if a non-cloneable object is used for a series key).
-