public class XYSeriesCollection extends AbstractIntervalXYDataset implements IntervalXYDataset, DomainInfo, RangeInfo, java.beans.VetoableChangeListener, PublicCloneable, java.io.Serializable
XYSeries objects that can be used as a
dataset.| Constructor and Description |
|---|
XYSeriesCollection()
Constructs an empty dataset.
|
XYSeriesCollection(XYSeries series)
Constructs a dataset and populates it with a single series.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSeries(XYSeries series)
Adds a series to the collection and sends a
DatasetChangeEvent
to all registered listeners. |
java.lang.Object |
clone()
Returns a clone of this instance.
|
boolean |
equals(java.lang.Object obj)
Tests this collection for equality with an arbitrary object.
|
Range |
getDomainBounds(boolean includeInterval)
Returns the range of the values in this dataset's domain.
|
double |
getDomainLowerBound(boolean includeInterval)
Returns the minimum x-value in the dataset.
|
DomainOrder |
getDomainOrder()
Returns the order of the domain (X) values, if this is known.
|
double |
getDomainUpperBound(boolean includeInterval)
Returns the maximum x-value in the dataset.
|
java.lang.Number |
getEndX(int series,
int item)
Returns the ending X value for the specified series and item.
|
java.lang.Number |
getEndY(int series,
int item)
Returns the ending Y value for the specified series and item.
|
double |
getIntervalPositionFactor()
Returns the interval position factor.
|
double |
getIntervalWidth()
Returns the interval width.
|
int |
getItemCount(int series)
Returns the number of items in the specified series.
|
Range |
getRangeBounds(boolean includeInterval)
Returns the range of the values in this dataset's range.
|
double |
getRangeLowerBound(boolean includeInterval)
Returns the minimum y-value in the dataset.
|
double |
getRangeUpperBound(boolean includeInterval)
Returns the maximum y-value in the dataset.
|
java.util.List |
getSeries()
Returns a list of all the series in the collection.
|
XYSeries |
getSeries(java.lang.Comparable key)
Returns a series from the collection.
|
XYSeries |
getSeries(int series)
Returns a series from the collection.
|
int |
getSeriesCount()
Returns the number of series in the collection.
|
int |
getSeriesIndex(java.lang.Comparable key)
Returns the index of the series with the specified key, or -1 if no
series has that key.
|
java.lang.Comparable |
getSeriesKey(int series)
Returns the key for a series.
|
java.lang.Number |
getStartX(int series,
int item)
Returns the starting X value for the specified series and item.
|
java.lang.Number |
getStartY(int series,
int item)
Returns the starting Y value for the specified series and item.
|
java.lang.Number |
getX(int series,
int item)
Returns the x-value for the specified series and item.
|
java.lang.Number |
getY(int series,
int index)
Returns the y-value for the specified series and item.
|
int |
hashCode()
Returns a hash code.
|
int |
indexOf(XYSeries series)
Returns the index of the specified series, or -1 if that series is not
present in the dataset.
|
boolean |
isAutoWidth()
Returns whether the interval width is automatically calculated or not.
|
void |
removeAllSeries()
Removes all the series from the collection and sends a
DatasetChangeEvent to all registered listeners. |
void |
removeSeries(int series)
Removes a series from the collection and sends a
DatasetChangeEvent to all registered listeners. |
void |
removeSeries(XYSeries series)
Removes a series from the collection and sends a
DatasetChangeEvent to all registered listeners. |
void |
setAutoWidth(boolean b)
Sets the flag that indicates whether the interval width is automatically
calculated or not.
|
void |
setIntervalPositionFactor(double factor)
Sets the interval position factor.
|
void |
setIntervalWidth(double width)
Sets the interval width and sends a
DatasetChangeEvent to all
registered listeners. |
void |
vetoableChange(java.beans.PropertyChangeEvent e)
Receives notification that the key for one of the series in the
collection has changed, and vetos it if the key is already present in
the collection.
|
getEndXValue, getEndYValue, getStartXValue, getStartYValuegetXValue, getYValueindexOf, seriesChangedaddChangeListener, fireDatasetChanged, getGroup, getNotify, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObjectfinalize, getClass, notify, notifyAll, toString, wait, wait, waitgetEndXValue, getEndYValue, getStartXValue, getStartYValueindexOfaddChangeListener, getGroup, removeChangeListener, setGrouppublic XYSeriesCollection()
public XYSeriesCollection(XYSeries series)
series - the series (null ignored).public DomainOrder getDomainOrder()
getDomainOrder in interface XYDatasetgetDomainOrder in class AbstractXYDatasetpublic void addSeries(XYSeries series)
DatasetChangeEvent
to all registered listeners.series - the series (null not permitted).java.lang.IllegalArgumentException - if the key for the series is null or
not unique within the dataset.public void removeSeries(int series)
DatasetChangeEvent to all registered listeners.series - the series index (zero-based).public void removeSeries(XYSeries series)
DatasetChangeEvent to all registered listeners.series - the series (null not permitted).public void removeAllSeries()
DatasetChangeEvent to all registered listeners.public int getSeriesCount()
getSeriesCount in interface SeriesDatasetgetSeriesCount in class AbstractSeriesDatasetpublic java.util.List getSeries()
public int indexOf(XYSeries series)
series - the series (null not permitted).public XYSeries getSeries(int series)
series - the series index (zero-based).java.lang.IllegalArgumentException - if series is not in the
range 0 to getSeriesCount() - 1.public XYSeries getSeries(java.lang.Comparable key)
key - the key (null not permitted).UnknownKeyException - if key is not found in the
collection.public java.lang.Comparable getSeriesKey(int series)
getSeriesKey in interface SeriesDatasetgetSeriesKey in class AbstractSeriesDatasetseries - the series index (in the range 0 to
getSeriesCount() - 1).java.lang.IllegalArgumentException - if series is not in the
specified range.public int getSeriesIndex(java.lang.Comparable key)
key - the key (null not permitted).public int getItemCount(int series)
getItemCount in interface XYDatasetseries - the series (zero-based index).java.lang.IllegalArgumentException - if series is not in the
range 0 to getSeriesCount() - 1.public java.lang.Number getX(int series,
int item)
public java.lang.Number getStartX(int series,
int item)
getStartX in interface IntervalXYDatasetseries - the series (zero-based index).item - the item (zero-based index).public java.lang.Number getEndX(int series,
int item)
getEndX in interface IntervalXYDatasetseries - the series (zero-based index).item - the item (zero-based index).public java.lang.Number getY(int series,
int index)
public java.lang.Number getStartY(int series,
int item)
getStartY in interface IntervalXYDatasetseries - the series (zero-based index).item - the item (zero-based index).public java.lang.Number getEndY(int series,
int item)
getEndY in interface IntervalXYDatasetseries - the series (zero-based index).item - the item (zero-based index).public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object (null permitted).public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface PublicCloneableclone in class AbstractDatasetjava.lang.CloneNotSupportedException - if there is a problem.public int hashCode()
hashCode in class java.lang.Objectpublic double getDomainLowerBound(boolean includeInterval)
getDomainLowerBound in interface DomainInfoincludeInterval - a flag that determines whether or not the
x-interval is taken into account.public double getDomainUpperBound(boolean includeInterval)
getDomainUpperBound in interface DomainInfoincludeInterval - a flag that determines whether or not the
x-interval is taken into account.public Range getDomainBounds(boolean includeInterval)
getDomainBounds in interface DomainInfoincludeInterval - a flag that determines whether or not the
x-interval is taken into account.null if the dataset contains no
values).public double getIntervalWidth()
IntervalXYDataset.public void setIntervalWidth(double width)
DatasetChangeEvent to all
registered listeners.width - the width (negative values not permitted).public double getIntervalPositionFactor()
public void setIntervalPositionFactor(double factor)
factor - the factor.public boolean isAutoWidth()
public void setAutoWidth(boolean b)
b - a boolean.public Range getRangeBounds(boolean includeInterval)
getRangeBounds in interface RangeInfoincludeInterval - ignored.null if the dataset contains no
values).public double getRangeLowerBound(boolean includeInterval)
getRangeLowerBound in interface RangeInfoincludeInterval - a flag that determines whether or not the
y-interval is taken into account.public double getRangeUpperBound(boolean includeInterval)
getRangeUpperBound in interface RangeInfoincludeInterval - a flag that determines whether or not the
y-interval is taken into account.public void vetoableChange(java.beans.PropertyChangeEvent e)
throws java.beans.PropertyVetoException
vetoableChange in interface java.beans.VetoableChangeListenere - the event.java.beans.PropertyVetoException