Package org.jfree.data.time
Class TimePeriodValuesCollection
java.lang.Object
org.jfree.data.general.AbstractDataset
org.jfree.data.general.AbstractSeriesDataset
org.jfree.data.xy.AbstractXYDataset
org.jfree.data.xy.AbstractIntervalXYDataset
org.jfree.data.time.TimePeriodValuesCollection
- All Implemented Interfaces:
ObjectInputValidation
,Serializable
,Cloneable
,EventListener
,DomainInfo
,Dataset
,SeriesChangeListener
,SeriesDataset
,IntervalXYDataset
,XYDataset
public class TimePeriodValuesCollection
extends AbstractIntervalXYDataset
implements IntervalXYDataset, DomainInfo, Serializable
A collection of
TimePeriodValues
objects.
This class implements the XYDataset
interface, as
well as the extended IntervalXYDataset
interface. This makes it a
convenient dataset for use with the XYPlot
class.
- See Also:
-
Constructor Summary
ConstructorDescriptionConstructs an empty dataset.Constructs a dataset containing a single series. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSeries
(TimePeriodValues series) Adds a series to the collection.boolean
Tests this instance for equality with an arbitrary object.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.double
getDomainUpperBound
(boolean includeInterval) Returns the maximum x-value in the dataset.getEndX
(int series, int item) Returns the ending X value for the specified series and item.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.getSeries
(int series) Returns a series.int
Returns the number of series in the collection.getSeriesKey
(int series) Returns the key for a series.getStartX
(int series, int item) Returns the starting X value for the specified series and item.getStartY
(int series, int item) Returns the starting Y value for the specified series and item.getX
(int series, int item) Returns the x-value for the specified series and item.Returns the position of the X value within each time period.getY
(int series, int item) Returns the y-value for the specified series and item.void
removeSeries
(int index) Removes a series from the collection.void
removeSeries
(TimePeriodValues series) Removes the specified series from the collection.void
setXPosition
(TimePeriodAnchor position) Sets the position of the x axis within each time period.Methods inherited from class org.jfree.data.xy.AbstractIntervalXYDataset
getEndXValue, getEndYValue, getStartXValue, getStartYValue
Methods inherited from class org.jfree.data.xy.AbstractXYDataset
getDomainOrder, getXValue, getYValue
Methods inherited from class org.jfree.data.general.AbstractSeriesDataset
indexOf, seriesChanged
Methods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, canEqual, clone, fireDatasetChanged, getGroup, getNotify, hashCode, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObject
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
Methods inherited from interface org.jfree.data.xy.IntervalXYDataset
getEndXValue, getEndYValue, getStartXValue, getStartYValue
Methods inherited from interface org.jfree.data.general.SeriesDataset
indexOf
Methods inherited from interface org.jfree.data.xy.XYDataset
getDomainOrder, getXValue, getYValue
-
Constructor Details
-
TimePeriodValuesCollection
public TimePeriodValuesCollection()Constructs an empty dataset. -
TimePeriodValuesCollection
Constructs a dataset containing a single series. Additional series can be added.- Parameters:
series
- the series (null
ignored).
-
-
Method Details
-
getXPosition
Returns the position of the X value within each time period.- Returns:
- The position (never
null
). - See Also:
-
setXPosition
Sets the position of the x axis within each time period.- Parameters:
position
- the position (null
not permitted).- See Also:
-
getSeriesCount
Returns the number of series in the collection.- Specified by:
getSeriesCount
in interfaceSeriesDataset
- Specified by:
getSeriesCount
in classAbstractSeriesDataset
- Returns:
- The series count.
-
getSeries
Returns a series.- Parameters:
series
- the index of the series (zero-based).- Returns:
- The series.
-
getSeriesKey
Returns the key for a series.- Specified by:
getSeriesKey
in interfaceSeriesDataset
- Specified by:
getSeriesKey
in classAbstractSeriesDataset
- Parameters:
series
- the index of the series (zero-based).- Returns:
- The key for a series.
-
addSeries
Adds a series to the collection. ADatasetChangeEvent
is sent to all registered listeners.- Parameters:
series
- the time series.
-
removeSeries
Removes the specified series from the collection.- Parameters:
series
- the series to remove (null
not permitted).
-
removeSeries
Removes a series from the collection.- Parameters:
index
- the series index (zero-based).
-
getItemCount
Returns the number of items in the specified series.This method is provided for convenience.
- Specified by:
getItemCount
in interfaceXYDataset
- Parameters:
series
- the index of the series of interest (zero-based).- Returns:
- The number of items in the specified series.
-
getX
Returns the x-value for the specified series and item. -
getStartX
Returns the starting X value for the specified series and item.- Specified by:
getStartX
in interfaceIntervalXYDataset
- Parameters:
series
- the series (zero-based index).item
- the item (zero-based index).- Returns:
- The starting X value for the specified series and item.
-
getEndX
Returns the ending X value for the specified series and item.- Specified by:
getEndX
in interfaceIntervalXYDataset
- Parameters:
series
- the series (zero-based index).item
- the item (zero-based index).- Returns:
- The ending X value for the specified series and item.
-
getY
Returns the y-value for the specified series and item. -
getStartY
Returns the starting Y value for the specified series and item.- Specified by:
getStartY
in interfaceIntervalXYDataset
- Parameters:
series
- the series (zero-based index).item
- the item (zero-based index).- Returns:
- The starting Y value for the specified series and item.
-
getEndY
Returns the ending Y value for the specified series and item.- Specified by:
getEndY
in interfaceIntervalXYDataset
- Parameters:
series
- the series (zero-based index).item
- the item (zero-based index).- Returns:
- The ending Y value for the specified series and item.
-
getDomainLowerBound
Returns the minimum x-value in the dataset.- Specified by:
getDomainLowerBound
in interfaceDomainInfo
- Parameters:
includeInterval
- a flag that determines whether or not the x-interval is taken into account.- Returns:
- The minimum value.
-
getDomainUpperBound
Returns the maximum x-value in the dataset.- Specified by:
getDomainUpperBound
in interfaceDomainInfo
- Parameters:
includeInterval
- a flag that determines whether or not the x-interval is taken into account.- Returns:
- The maximum value.
-
getDomainBounds
Returns the range of the values in this dataset's domain.- Specified by:
getDomainBounds
in interfaceDomainInfo
- Parameters:
includeInterval
- a flag that determines whether or not the x-interval is taken into account.- Returns:
- The range.
-
equals
Tests this instance for equality with an arbitrary object.- Overrides:
equals
in classAbstractDataset
- Parameters:
obj
- the object (null
permitted).- Returns:
- A boolean.
-