Package org.jfree.data.time
Class TimeTableXYDataset
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.TimeTableXYDataset
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Cloneable,EventListener,PublicCloneable,DomainInfo,Dataset,SeriesChangeListener,SeriesDataset,IntervalXYDataset,TableXYDataset,XYDataset
public class TimeTableXYDataset
extends AbstractIntervalXYDataset
implements Cloneable, PublicCloneable, IntervalXYDataset, DomainInfo, TableXYDataset
A dataset for regular time periods that implements the
TableXYDataset interface. Note that the TableXYDataset
interface requires all series to share the same set of x-values. When
adding a new item (x, y) to one series, all other series
automatically get a new item (x, null) unless a non-null item
has already been specified.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new dataset.TimeTableXYDataset(TimeZone zone) Creates a new dataset with the given time zone.TimeTableXYDataset(TimeZone zone, Locale locale) Creates a new dataset with the given time zone and locale. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(TimePeriod period, double y, Comparable seriesName) Adds a new data item to the dataset and sends aDatasetChangeEventto all registered listeners.voidadd(TimePeriod period, Number y, Comparable seriesName, boolean notify) Adds a new data item to the dataset and, if requested, sends aDatasetChangeEventto all registered listeners.voidclear()Removes all data items from the dataset and sends aDatasetChangeEventto all registered listeners.clone()Returns a clone of this dataset.booleanTests this dataset for equality with an arbitrary object.getDomainBounds(boolean includeInterval) Returns the range of the values in this dataset's domain.booleanReturns a flag that controls whether the domain is treated as 'points in time'.doublegetDomainLowerBound(boolean includeInterval) Returns the minimum x-value in the dataset.doublegetDomainUpperBound(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.doublegetEndXValue(int series, int item) Returns the end x-value (as a double primitive) for an item within a series.getEndY(int series, int item) Returns the ending Y value for the specified series and item.intReturns the number of items in ALL series.intgetItemCount(int series) Returns the number of items in a series.intReturns the number of series in the dataset.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.doublegetStartXValue(int series, int item) Returns the start x-value (as a double primitive) for an item within a series.getStartY(int series, int item) Returns the starting Y value for the specified series and item.getTimePeriod(int item) Returns the time period for the specified item.getX(int series, int item) Returns the x-value for an item within a series.Returns the position within each time period that is used for the X value.doublegetXValue(int series, int item) Returns the x-value (as a double primitive) for an item within a series.getY(int series, int item) Returns the y-value for an item within a series.voidremove(TimePeriod period, Comparable seriesName) Removes an existing data item from the dataset.voidremove(TimePeriod period, Comparable seriesName, boolean notify) Removes an existing data item from the dataset and, if requested, sends aDatasetChangeEventto all registered listeners.voidsetDomainIsPointsInTime(boolean flag) Sets a flag that controls whether the domain is treated as 'points in time', or time periods.voidsetXPosition(TimePeriodAnchor anchor) Sets the position within each time period that is used for the X values, then sends aDatasetChangeEventto all registered listeners.Methods inherited from class org.jfree.data.xy.AbstractIntervalXYDataset
getEndYValue, getStartYValueMethods inherited from class org.jfree.data.xy.AbstractXYDataset
getDomainOrder, getYValueMethods inherited from class org.jfree.data.general.AbstractSeriesDataset
indexOf, seriesChangedMethods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, canEqual, fireDatasetChanged, getGroup, getNotify, hashCode, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObjectMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroupMethods inherited from interface org.jfree.data.xy.IntervalXYDataset
getEndYValue, getStartYValueMethods inherited from interface org.jfree.data.general.SeriesDataset
indexOfMethods inherited from interface org.jfree.data.xy.XYDataset
getDomainOrder, getYValue
-
Constructor Details
-
TimeTableXYDataset
public TimeTableXYDataset()Creates a new dataset. -
TimeTableXYDataset
Creates a new dataset with the given time zone.- Parameters:
zone- the time zone to use (nullnot permitted).
-
TimeTableXYDataset
Creates a new dataset with the given time zone and locale.- Parameters:
zone- the time zone to use (nullnot permitted).locale- the locale to use (nullnot permitted).
-
-
Method Details
-
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.
- See Also:
-
setDomainIsPointsInTime
Sets a flag that controls whether the domain is treated as 'points in time', or time periods. ADatasetChangeEventis sent to all registered listeners.- Parameters:
flag- the new value of the flag.- See Also:
-
getXPosition
Returns the position within each time period that is used for the X value.- Returns:
- The anchor position (never
null). - See Also:
-
setXPosition
Sets the position within each time period that is used for the X values, then sends aDatasetChangeEventto all registered listeners.- Parameters:
anchor- the anchor position (nullnot permitted).- See Also:
-
add
Adds a new data item to the dataset and sends aDatasetChangeEventto all registered listeners.- Parameters:
period- the time period.y- the value for this period.seriesName- the name of the series to add the value.- See Also:
-
add
Adds a new data item to the dataset and, if requested, sends aDatasetChangeEventto all registered listeners.- Parameters:
period- the time period (nullnot permitted).y- the value for this period (nullpermitted).seriesName- the name of the series to add the value (nullnot permitted).notify- whether dataset listener are notified or not.- See Also:
-
remove
Removes an existing data item from the dataset.- Parameters:
period- the (existing!) time period of the value to remove (nullnot permitted).seriesName- the (existing!) series name to remove the value (nullnot permitted).- See Also:
-
remove
Removes an existing data item from the dataset and, if requested, sends aDatasetChangeEventto all registered listeners.- Parameters:
period- the (existing!) time period of the value to remove (nullnot permitted).seriesName- the (existing!) series name to remove the value (nullnot permitted).notify- whether dataset listener are notified or not.- See Also:
-
clear
Removes all data items from the dataset and sends aDatasetChangeEventto all registered listeners. -
getTimePeriod
Returns the time period for the specified item. Bear in mind that all series share the same set of time periods.- Parameters:
item- the item index (0 <= i <=getItemCount()).- Returns:
- The time period.
-
getItemCount
Returns the number of items in ALL series.- Specified by:
getItemCountin interfaceTableXYDataset- Returns:
- The item count.
-
getItemCount
Returns the number of items in a series. This is the same value that is returned bygetItemCount()since all series share the same x-values (time periods).- Specified by:
getItemCountin interfaceXYDataset- Parameters:
series- the series (zero-based index, ignored).- Returns:
- The number of items within the series.
-
getSeriesCount
Returns the number of series in the dataset.- Specified by:
getSeriesCountin interfaceSeriesDataset- Specified by:
getSeriesCountin classAbstractSeriesDataset- Returns:
- The series count.
-
getSeriesKey
Returns the key for a series.- Specified by:
getSeriesKeyin interfaceSeriesDataset- Specified by:
getSeriesKeyin classAbstractSeriesDataset- Parameters:
series- the series (zero-based index).- Returns:
- The key for the series.
-
getX
Returns the x-value for an item within a series. The x-values may or may not be returned in ascending order, that is up to the class implementing the interface. -
getXValue
Returns the x-value (as a double primitive) for an item within a series.- Specified by:
getXValuein interfaceXYDataset- Overrides:
getXValuein classAbstractXYDataset- Parameters:
series- the series index (zero-based).item- the item index (zero-based).- Returns:
- The value.
-
getStartX
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 within a series (zero-based index).- Returns:
- The starting X value for the specified series and item.
- See Also:
-
getStartXValue
Returns the start x-value (as a double primitive) for an item within a series.- Specified by:
getStartXValuein interfaceIntervalXYDataset- Overrides:
getStartXValuein classAbstractIntervalXYDataset- Parameters:
series- the series index (zero-based).item- the item index (zero-based).- Returns:
- The value.
- See Also:
-
getEndX
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 within a series (zero-based index).- Returns:
- The ending X value for the specified series and item.
- See Also:
-
getEndXValue
Returns the end x-value (as a double primitive) for an item within a series.- Specified by:
getEndXValuein interfaceIntervalXYDataset- Overrides:
getEndXValuein classAbstractIntervalXYDataset- Parameters:
series- the series index (zero-based).item- the item index (zero-based).- Returns:
- The value.
- See Also:
-
getY
Returns the y-value for an item within a series. -
getStartY
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 within a series (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:
getEndYin interfaceIntervalXYDataset- Parameters:
series- the series (zero-based index).item- the item within a series (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:
getDomainLowerBoundin 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:
getDomainUpperBoundin 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:
getDomainBoundsin interfaceDomainInfo- Parameters:
includeInterval- a flag that controls whether or not the x-intervals are taken into account.- Returns:
- The range.
-
equals
Tests this dataset for equality with an arbitrary object.- Overrides:
equalsin classAbstractDataset- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
clone
Returns a clone of this dataset.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classAbstractDataset- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if the dataset cannot be cloned.
-