- java.lang.Object
-
- org.jfree.data.general.AbstractDataset
-
- org.jfree.data.general.AbstractSeriesDataset<S>
-
- org.jfree.data.xy.AbstractXYDataset<S>
-
- 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 ofTimePeriodValuesobjects.This class implements the
XYDatasetinterface, as well as the extendedIntervalXYDatasetinterface. This makes it a convenient dataset for use with theXYPlotclass.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TimePeriodValuesCollection()Constructs an empty dataset.TimePeriodValuesCollection(TimePeriodValues series)Constructs a dataset containing a single series.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSeries(TimePeriodValues series)Adds a series to the collection.booleanequals(Object obj)Tests this instance for equality with an arbitrary object.RangegetDomainBounds(boolean includeInterval)Returns the range of the values in this dataset's domain.doublegetDomainLowerBound(boolean includeInterval)Returns the minimum x-value in the dataset.doublegetDomainUpperBound(boolean includeInterval)Returns the maximum x-value in the dataset.NumbergetEndX(int series, int item)Returns the ending X value for the specified series and item.NumbergetEndY(int series, int item)Returns the ending Y value for the specified series and item.intgetItemCount(int series)Returns the number of items in the specified series.TimePeriodValuesgetSeries(int series)Returns a series.intgetSeriesCount()Returns the number of series in the collection.ComparablegetSeriesKey(int series)Returns the key for a series.NumbergetStartX(int series, int item)Returns the starting X value for the specified series and item.NumbergetStartY(int series, int item)Returns the starting Y value for the specified series and item.NumbergetX(int series, int item)Returns the x-value for the specified series and item.TimePeriodAnchorgetXPosition()Returns the position of the X value within each time period.NumbergetY(int series, int item)Returns the y-value for the specified series and item.inthashCode()voidremoveSeries(int index)Removes a series from the collection.voidremoveSeries(TimePeriodValues series)Removes the specified series from the collection.voidsetXPosition(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, clone, fireDatasetChanged, getNotify, hasListener, notifyListeners, removeChangeListener, 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, removeChangeListener
-
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 Detail
-
TimePeriodValuesCollection
public TimePeriodValuesCollection()
Constructs an empty dataset.
-
TimePeriodValuesCollection
public TimePeriodValuesCollection(TimePeriodValues series)
Constructs a dataset containing a single series. Additional series can be added.- Parameters:
series- the series (nullignored).
-
-
Method Detail
-
getXPosition
public TimePeriodAnchor getXPosition()
Returns the position of the X value within each time period.- Returns:
- The position (never
null). - See Also:
setXPosition(TimePeriodAnchor)
-
setXPosition
public void setXPosition(TimePeriodAnchor position)
Sets the position of the x axis within each time period.- Parameters:
position- the position (nullnot permitted).- See Also:
getXPosition()
-
getSeriesCount
public int getSeriesCount()
Returns the number of series in the collection.- Specified by:
getSeriesCountin interfaceSeriesDataset- Specified by:
getSeriesCountin classAbstractSeriesDataset- Returns:
- The series count.
-
getSeries
public TimePeriodValues getSeries(int series)
Returns a series.- Parameters:
series- the index of the series (zero-based).- Returns:
- The series.
-
getSeriesKey
public Comparable getSeriesKey(int series)
Returns the key for a series.- Specified by:
getSeriesKeyin interfaceSeriesDataset- Specified by:
getSeriesKeyin classAbstractSeriesDataset- Parameters:
series- the index of the series (zero-based).- Returns:
- The key for a series.
-
addSeries
public void addSeries(TimePeriodValues series)
Adds a series to the collection. ADatasetChangeEventis sent to all registered listeners.- Parameters:
series- the time series.
-
removeSeries
public void removeSeries(TimePeriodValues series)
Removes the specified series from the collection.- Parameters:
series- the series to remove (nullnot permitted).
-
removeSeries
public void removeSeries(int index)
Removes a series from the collection.- Parameters:
index- the series index (zero-based).
-
getItemCount
public int getItemCount(int series)
Returns the number of items in the specified series.This method is provided for convenience.
- Specified by:
getItemCountin interfaceXYDataset- Parameters:
series- the index of the series of interest (zero-based).- Returns:
- The number of items in the specified series.
-
getX
public Number getX(int series, int item)
Returns the x-value for the specified series and item.
-
getStartX
public Number getStartX(int series, int item)
Returns the starting X value for the specified series and item.- Specified by:
getStartXin 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
public Number getEndX(int series, int item)
Returns the ending X value for the specified series and item.- Specified by:
getEndXin 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
public Number getY(int series, int item)
Returns the y-value for the specified series and item.
-
getStartY
public Number getStartY(int series, int item)
Returns the starting Y value for the specified series and item.- Specified by:
getStartYin 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
public Number getEndY(int series, int item)
Returns the ending Y value for the specified series and item.- Specified by:
getEndYin 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
public double getDomainLowerBound(boolean includeInterval)
Returns the minimum x-value in the dataset.- Specified by:
getDomainLowerBoundin interfaceDomainInfo- Parameters:
includeInterval- a flag that determines whether or not the x-interval is taken into account.- Returns:
- The minimum value.
-
getDomainUpperBound
public double getDomainUpperBound(boolean includeInterval)
Returns the maximum x-value in the dataset.- Specified by:
getDomainUpperBoundin interfaceDomainInfo- Parameters:
includeInterval- a flag that determines whether or not the x-interval is taken into account.- Returns:
- The maximum value.
-
getDomainBounds
public Range getDomainBounds(boolean includeInterval)
Returns the range of the values in this dataset's domain.- Specified by:
getDomainBoundsin interfaceDomainInfo- Parameters:
includeInterval- a flag that determines whether or not the x-interval is taken into account.- Returns:
- The range.
-
equals
public boolean equals(Object obj)
Tests this instance for equality with an arbitrary object.
-
-