public class TimeSeriesCollection extends AbstractIntervalXYDataset implements XYDataset, IntervalXYDataset, DomainInfo, XYDomainInfo, XYRangeInfo, VetoableChangeListener, Serializable
XYDataset interface, as well as the extended
IntervalXYDataset interface. This makes it a convenient dataset for
use with the XYPlot class.| Constructor and Description |
|---|
TimeSeriesCollection()
Constructs an empty dataset, tied to the default timezone.
|
TimeSeriesCollection(TimeSeries series)
Constructs a dataset containing a single series (more can be added),
tied to the default timezone.
|
TimeSeriesCollection(TimeSeries series,
TimeZone zone)
Constructs a dataset containing a single series (more can be added),
tied to a specific timezone.
|
TimeSeriesCollection(TimeZone zone)
Constructs an empty dataset, tied to a specific timezone.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSeries(TimeSeries series)
Adds a series to the collection and sends a
DatasetChangeEvent to
all registered listeners. |
Object |
clone()
Returns a clone of this time series collection.
|
boolean |
equals(Object obj)
Tests this time series collection for equality with another object.
|
Range |
getDomainBounds(boolean includeInterval)
Returns the range of the values in this dataset's domain.
|
Range |
getDomainBounds(List visibleSeriesKeys,
boolean includeInterval)
Returns the bounds of the domain values for the specified series.
|
double |
getDomainLowerBound(boolean includeInterval)
Returns the minimum x-value in the dataset.
|
DomainOrder |
getDomainOrder()
Returns the order of the domain values in this dataset.
|
double |
getDomainUpperBound(boolean includeInterval)
Returns the maximum x-value in the dataset.
|
Number |
getEndX(int series,
int item)
Returns the ending X value for the specified series and item.
|
Number |
getEndY(int series,
int item)
Returns the ending Y value for the specified series and item.
|
int |
getItemCount(int series)
Returns the number of items in the specified series.
|
Range |
getRangeBounds(boolean includeInterval)
Returns the bounds for the y-values in the dataset.
|
Range |
getRangeBounds(List visibleSeriesKeys,
Range xRange,
boolean includeInterval)
Returns the bounds for the y-values in the dataset.
|
List |
getSeries()
Returns a list of all the series in the collection.
|
TimeSeries |
getSeries(Comparable key)
Returns the series with the specified key, or
null if
there is no such series. |
TimeSeries |
getSeries(int series)
Returns a series.
|
int |
getSeriesCount()
Returns the number of series in the collection.
|
int |
getSeriesIndex(Comparable key)
Returns the index of the series with the specified key, or -1 if no
series has that key.
|
Comparable |
getSeriesKey(int series)
Returns the key for a series.
|
Number |
getStartX(int series,
int item)
Returns the starting X value for the specified series and item.
|
Number |
getStartY(int series,
int item)
Returns the starting Y value for the specified series and item.
|
int[] |
getSurroundingItems(int series,
long milliseconds)
Returns the indices of the two data items surrounding a particular
millisecond value.
|
Number |
getX(int series,
int item)
Returns the x-value for the specified series and item.
|
protected long |
getX(RegularTimePeriod period)
Returns the x-value for a time period.
|
TimePeriodAnchor |
getXPosition()
Returns the position within each time period that is used for the X
value when the collection is used as an
XYDataset. |
double |
getXValue(int series,
int item)
Returns the x-value (as a double primitive) for an item within a series.
|
Number |
getY(int series,
int item)
Returns the y-value for the specified series and item.
|
int |
hashCode()
Returns a hash code value for the object.
|
int |
indexOf(TimeSeries series)
Returns the index of the specified series, or -1 if that series is not
present in the dataset.
|
void |
removeAllSeries()
Removes all the series from the collection and sends a
DatasetChangeEvent to all registered listeners. |
void |
removeSeries(int index)
Removes a series from the collection.
|
void |
removeSeries(TimeSeries series)
Removes the specified series from the collection and sends a
DatasetChangeEvent to all registered listeners. |
void |
setXPosition(TimePeriodAnchor anchor)
Sets the position within each time period that is used for the X values
when the collection is used as an
XYDataset, then sends a
DatasetChangeEvent is sent to all registered listeners. |
void |
vetoableChange(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, getStartYValuegetYValueindexOf, seriesChangedaddChangeListener, fireDatasetChanged, getGroup, getNotify, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObjectfinalize, getClass, notify, notifyAll, toString, wait, wait, waitgetEndXValue, getEndYValue, getStartXValue, getStartYValueindexOfaddChangeListener, getGroup, removeChangeListener, setGrouppublic TimeSeriesCollection()
public TimeSeriesCollection(TimeZone zone)
zone - the timezone (null permitted, will use
TimeZone.getDefault() in that case).public TimeSeriesCollection(TimeSeries series)
series - the series (null permitted).public TimeSeriesCollection(TimeSeries series, TimeZone zone)
series - a series to add to the collection (null
permitted).zone - the timezone (null permitted, will use
TimeZone.getDefault() in that case).public DomainOrder getDomainOrder()
getDomainOrder in interface XYDatasetgetDomainOrder in class AbstractXYDatasetDomainOrder.ASCENDINGpublic TimePeriodAnchor getXPosition()
XYDataset.null).public void setXPosition(TimePeriodAnchor anchor)
XYDataset, then sends a
DatasetChangeEvent is sent to all registered listeners.anchor - the anchor position (null not permitted).public List getSeries()
public int getSeriesCount()
getSeriesCount in interface SeriesDatasetgetSeriesCount in class AbstractSeriesDatasetpublic int indexOf(TimeSeries series)
series - the series (null not permitted).public TimeSeries getSeries(int series)
series - the index of the series (zero-based).public TimeSeries getSeries(Comparable key)
null if
there is no such series.key - the series key (null permitted).public Comparable getSeriesKey(int series)
getSeriesKey in interface SeriesDatasetgetSeriesKey in class AbstractSeriesDatasetseries - the index of the series (zero-based).public int getSeriesIndex(Comparable key)
key - the key (null not permitted).public void addSeries(TimeSeries series)
DatasetChangeEvent to
all registered listeners.series - the series (null not permitted).public void removeSeries(TimeSeries series)
DatasetChangeEvent to all registered listeners.series - the series (null not permitted).public void removeSeries(int index)
index - the series index (zero-based).public void removeAllSeries()
DatasetChangeEvent to all registered listeners.public int getItemCount(int series)
getItemCount in interface XYDatasetseries - the series index (zero-based).public double getXValue(int series,
int item)
getXValue in interface XYDatasetgetXValue in class AbstractXYDatasetseries - the series (zero-based index).item - the item (zero-based index).public Number getX(int series, int item)
protected long getX(RegularTimePeriod period)
period - the time period (null not permitted).public Number getStartX(int series, int item)
getStartX in interface IntervalXYDatasetseries - the series (zero-based index).item - the item (zero-based index).public Number getEndX(int series, int item)
getEndX in interface IntervalXYDatasetseries - The series (zero-based index).item - The item (zero-based index).public Number getY(int series, int item)
public Number getStartY(int series, int item)
getStartY in interface IntervalXYDatasetseries - the series (zero-based index).item - the item (zero-based index).null).public Number getEndY(int series, int item)
getEndY in interface IntervalXYDatasetseries - te series (zero-based index).item - the item (zero-based index).null).public int[] getSurroundingItems(int series,
long milliseconds)
series - the series index.milliseconds - the time.public 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.public Range getDomainBounds(List visibleSeriesKeys, boolean includeInterval)
getDomainBounds in interface XYDomainInfovisibleSeriesKeys - a list of keys for the visible series.includeInterval - include the x-interval?public Range getRangeBounds(boolean includeInterval)
includeInterval - ignored for this dataset.null).public Range getRangeBounds(List visibleSeriesKeys, Range xRange, boolean includeInterval)
getRangeBounds in interface XYRangeInfovisibleSeriesKeys - the visible series keys.xRange - the x-range (null not permitted).includeInterval - ignored.public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException
vetoableChange in interface VetoableChangeListenere - the event.PropertyVetoExceptionpublic boolean equals(Object obj)
public int hashCode()
public Object clone() throws CloneNotSupportedException
clone in class AbstractDatasetCloneNotSupportedException - if there is a problem
cloning.Copyright © 2001–2017 JFree.org. All rights reserved.