Package org.jfree.data.time
Class TimePeriodValuesCollection
java.lang.Object
org.jfree.data.AbstractDataset
org.jfree.data.AbstractSeriesDataset
org.jfree.data.AbstractXYDataset
org.jfree.data.AbstractIntervalXYDataset
org.jfree.data.time.TimePeriodValuesCollection
- All Implemented Interfaces:
ObjectInputValidation
,Serializable
,Cloneable
,EventListener
,Dataset
,DomainInfo
,IntervalXYDataset
,SeriesChangeListener
,SeriesDataset
,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:
- Serialized Form
-
Field Summary
-
Constructor Summary
Constructors Constructor Description TimePeriodValuesCollection()
Constructs an empty dataset, tied to the default timezone.TimePeriodValuesCollection(TimeZone zone)
Deprecated.The TimeZone is ignored, use an alternative constructor.TimePeriodValuesCollection(TimePeriodValues series)
Constructs a dataset containing a single series.TimePeriodValuesCollection(TimePeriodValues series, TimeZone zone)
Deprecated.TimeZone parameter is not used. -
Method Summary
Modifier and Type Method Description void
addSeries(TimePeriodValues series)
Adds a series to the collection.boolean
getDomainIsPointsInTime()
Returns a flag that controls whether the domain is treated as 'points in time'.Range
getDomainRange()
Returns the range of the values in the series domain.Number
getEndXValue(int series, int item)
Returns the ending X value for the specified series and item.Number
getEndYValue(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.Number
getMaximumDomainValue()
Returns the maximum value in the dataset (or null if all the values in the domain are null).Number
getMinimumDomainValue()
Returns the minimum value in the dataset (or null if all the values in the domain are null).int
getPosition()
Deprecated.Use getXPosition().TimePeriodValues
getSeries(int series)
Returns a series.int
getSeriesCount()
Returns the number of series in the collection.String
getSeriesName(int series)
Returns the name of a series.Number
getStartXValue(int series, int item)
Returns the starting X value for the specified series and item.Number
getStartYValue(int series, int item)
Returns the starting Y value for the specified series and item.TimePeriodAnchor
getXPosition()
Returns the position of the X value within each time period.Number
getXValue(int series, int item)
Returns the x-value for the specified series and item.Number
getYValue(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
setDomainIsPointsInTime(boolean flag)
Sets a flag that controls whether the domain is treated as 'points in time', or time periods.void
setPosition(int position)
Deprecated.Use setXPosition(...).void
setXPosition(TimePeriodAnchor position)
Sets the position of the x axis within each time period.Methods inherited from class org.jfree.data.AbstractIntervalXYDataset
getEndX, getEndY, getStartX, getStartY
Methods inherited from class org.jfree.data.AbstractXYDataset
getX, getY
Methods inherited from class org.jfree.data.AbstractSeriesDataset
seriesChanged
Methods inherited from class org.jfree.data.AbstractDataset
addChangeListener, clone, getGroup, removeChangeListener, setGroup, validateObject
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jfree.data.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
Methods inherited from interface org.jfree.data.IntervalXYDataset
getEndX, getEndY, getStartX, getStartY
-
Field Details
-
START
public static final int STARTDeprecated.Replaced by TimePeriodAnchor.START.Useful constant for controlling the x-value returned for a time period.- See Also:
- Constant Field Values
-
MIDDLE
public static final int MIDDLEDeprecated.Replaced by TimePeriodAnchor.MIDDLE.Useful constant for controlling the x-value returned for a time period.- See Also:
- Constant Field Values
-
END
public static final int ENDDeprecated.Replaced by TimePeriodAnchor.END.Useful constant for controlling the x-value returned for a time period.- See Also:
- Constant Field Values
-
-
Constructor Details
-
TimePeriodValuesCollection
public TimePeriodValuesCollection()Constructs an empty dataset, tied to the default timezone. -
TimePeriodValuesCollection
Deprecated.The TimeZone is ignored, use an alternative constructor.Constructs an empty dataset, tied to a specific timezone.- Parameters:
zone
- the timezone.
-
TimePeriodValuesCollection
Constructs a dataset containing a single series. Additional series can be added.- Parameters:
series
- the series.
-
TimePeriodValuesCollection
Deprecated.TimeZone parameter is not used.Constructs a dataset containing a single series (more can be added), tied to a specific timezone.- Parameters:
series
- the series.zone
- the timezone.
-
-
Method Details
-
getPosition
public int getPosition()Deprecated.Use getXPosition().Returns the position of the x-value returned for a time period (START, MIDDLE, or END).- Returns:
- the position.
-
setPosition
public void setPosition(int position)Deprecated.Use setXPosition(...).Sets the position - this controls the x-value that is returned for a particular time period.Use the constants START, MIDDLE and END.
- Parameters:
position
- the position.
-
getXPosition
Returns the position of the X value within each time period.- Returns:
- The position.
-
setXPosition
Sets the position of the x axis within each time period.- Parameters:
position
- the position.
-
getDomainIsPointsInTime
public boolean getDomainIsPointsInTime()Returns a flag that controls whether the domain is treated as 'points in time'.This flag is used when determining the max and min values for the domain. If true, then only the x-values are considered for the max and min values. If false, then the start and end x-values will also be taken into consideration
- Returns:
- The flag.
-
setDomainIsPointsInTime
public void setDomainIsPointsInTime(boolean flag)Sets a flag that controls whether the domain is treated as 'points in time', or time periods.- Parameters:
flag
- the new value of the flag.
-
getSeriesCount
public int 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.
-
getSeriesName
Returns the name of a series.This method is provided for convenience.
- Specified by:
getSeriesName
in interfaceSeriesDataset
- Specified by:
getSeriesName
in classAbstractSeriesDataset
- Parameters:
series
- The index of the series (zero-based).- Returns:
- the name of 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.
-
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:
getItemCount
in interfaceXYDataset
- Parameters:
series
- The index of the series of interest (zero-based).- Returns:
- the number of items in the specified series.
-
getXValue
Returns the x-value for the specified series and item. -
getStartXValue
Returns the starting X value for the specified series and item.- Specified by:
getStartXValue
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.
-
getEndXValue
Returns the ending X value for the specified series and item.- Specified by:
getEndXValue
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.
-
getYValue
Returns the y-value for the specified series and item. -
getStartYValue
Returns the starting Y value for the specified series and item.- Specified by:
getStartYValue
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.
-
getEndYValue
Returns the ending Y value for the specified series and item.- Specified by:
getEndYValue
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.
-
getMinimumDomainValue
Returns the minimum value in the dataset (or null if all the values in the domain are null).- Specified by:
getMinimumDomainValue
in interfaceDomainInfo
- Returns:
- the minimum value.
-
getMaximumDomainValue
Returns the maximum value in the dataset (or null if all the values in the domain are null).- Specified by:
getMaximumDomainValue
in interfaceDomainInfo
- Returns:
- the maximum value.
-
getDomainRange
Returns the range of the values in the series domain.- Specified by:
getDomainRange
in interfaceDomainInfo
- Returns:
- the range.
-