public class XYSeriesCollection extends AbstractIntervalXYDataset implements IntervalXYDataset, DomainInfo, RangeInfo, java.beans.VetoableChangeListener, org.jfree.util.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, getStartYValue
getXValue, getYValue
indexOf, seriesChanged
addChangeListener, fireDatasetChanged, getGroup, getNotify, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObject
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getEndXValue, getEndYValue, getStartXValue, getStartYValue
indexOf
addChangeListener, getGroup, removeChangeListener, setGroup
public XYSeriesCollection()
public XYSeriesCollection(XYSeries series)
series
- the series (null
ignored).public DomainOrder getDomainOrder()
getDomainOrder
in interface XYDataset
getDomainOrder
in class AbstractXYDataset
public 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 SeriesDataset
getSeriesCount
in class AbstractSeriesDataset
public 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 SeriesDataset
getSeriesKey
in class AbstractSeriesDataset
series
- 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 XYDataset
series
- 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 IntervalXYDataset
series
- the series (zero-based index).item
- the item (zero-based index).public java.lang.Number getEndX(int series, int item)
getEndX
in interface IntervalXYDataset
series
- 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 IntervalXYDataset
series
- the series (zero-based index).item
- the item (zero-based index).public java.lang.Number getEndY(int series, int item)
getEndY
in interface IntervalXYDataset
series
- the series (zero-based index).item
- the item (zero-based index).public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object (null
permitted).public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface org.jfree.util.PublicCloneable
clone
in class AbstractDataset
java.lang.CloneNotSupportedException
- if there is a problem.public int hashCode()
hashCode
in class java.lang.Object
public double getDomainLowerBound(boolean includeInterval)
getDomainLowerBound
in interface DomainInfo
includeInterval
- a flag that determines whether or not the
x-interval is taken into account.public double getDomainUpperBound(boolean includeInterval)
getDomainUpperBound
in interface DomainInfo
includeInterval
- a flag that determines whether or not the
x-interval is taken into account.public Range getDomainBounds(boolean includeInterval)
getDomainBounds
in interface DomainInfo
includeInterval
- 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 RangeInfo
includeInterval
- ignored.null
if the dataset contains no
values).public double getRangeLowerBound(boolean includeInterval)
getRangeLowerBound
in interface RangeInfo
includeInterval
- a flag that determines whether or not the
y-interval is taken into account.public double getRangeUpperBound(boolean includeInterval)
getRangeUpperBound
in interface RangeInfo
includeInterval
- 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.VetoableChangeListener
e
- the event.java.beans.PropertyVetoException