Package org.jfree.data.time
Class TimeTableXYDataset
java.lang.Object
org.jfree.data.AbstractDataset
org.jfree.data.AbstractSeriesDataset
org.jfree.data.AbstractXYDataset
org.jfree.data.AbstractIntervalXYDataset
org.jfree.data.time.TimeTableXYDataset
- All Implemented Interfaces:
ObjectInputValidation,Serializable,Cloneable,EventListener,Dataset,DomainInfo,IntervalXYDataset,SeriesChangeListener,SeriesDataset,TableXYDataset,XYDataset
public class TimeTableXYDataset extends AbstractIntervalXYDataset implements IntervalXYDataset, DomainInfo, TableXYDataset
A dataset for regular time periods that implements the TableXYDataset
interface.
- Author:
- andreas.schroeder
- See Also:
TableXYDataset, Serialized Form
-
Constructor Summary
Constructors Constructor Description TimeTableXYDataset()Creates a new TimeTableDataset.TimeTableXYDataset(TimeZone zone)Creates a new TimeTableDataset with the given time zone.TimeTableXYDataset(TimeZone zone, Locale locale)Creates a new TimeTableDataset with the given time zone and locale. -
Method Summary
Modifier and Type Method Description voidadd(RegularTimePeriod period, double y, String seriesName)Adds a new data item to the dataset.voidadd(RegularTimePeriod period, Number y, String seriesName, boolean notify)Adds a new data item to the dataset.booleangetDomainIsPointsInTime()Returns a flag that controls whether the domain is treated as 'points in time'.RangegetDomainRange()Returns the range of the values in this dataset's domain.NumbergetEndXValue(int series, int item)Returns the ending X value for the specified series and item.NumbergetEndYValue(int series, int item)Returns the ending Y value for the specified series and item.intgetItemCount()Returns the number of items every series.intgetItemCount(int series)Returns the number of items in a series.NumbergetMaximumDomainValue()Returns the maximum value in the dataset (ornullif all the values in the domain arenull).NumbergetMinimumDomainValue()Returns the minimum value in the dataset (ornullif all the values in the domain arenull).intgetSeriesCount()Returns the number of series in the dataset.StringgetSeriesName(int series)Returns the name of a series.NumbergetStartXValue(int series, int item)Returns the starting X value for the specified series and item.NumbergetStartYValue(int series, int item)Returns the starting Y value for the specified series and item.NumbergetXValue(int series, int item)Returns the x-value for an item within a series.NumbergetYValue(int series, int item)Returns the y-value for an item within a series.voidremove(RegularTimePeriod period, String seriesName)Removes an existing data item from the dataset.voidremove(RegularTimePeriod period, String seriesName, boolean notify)Removes an existing data item from the dataset.voidsetDomainIsPointsInTime(boolean flag)Sets a flag that controls whether the domain is treated as 'points in time', or time periods.Methods inherited from class org.jfree.data.AbstractIntervalXYDataset
getEndX, getEndY, getStartX, getStartYMethods inherited from class org.jfree.data.AbstractXYDataset
getX, getYMethods inherited from class org.jfree.data.AbstractSeriesDataset
seriesChangedMethods inherited from class org.jfree.data.AbstractDataset
addChangeListener, clone, getGroup, removeChangeListener, setGroup, validateObjectMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.data.Dataset
addChangeListener, getGroup, removeChangeListener, setGroupMethods inherited from interface org.jfree.data.IntervalXYDataset
getEndX, getEndY, getStartX, getStartY
-
Constructor Details
-
TimeTableXYDataset
public TimeTableXYDataset()Creates a new TimeTableDataset. -
TimeTableXYDataset
Creates a new TimeTableDataset with the given time zone.- Parameters:
zone- the time zone to use.
-
TimeTableXYDataset
Creates a new TimeTableDataset with the given time zone and locale.- Parameters:
zone- the time zone to use.locale- the locale to use.
-
-
Method Details
-
add
Adds a new data item to the dataset.- Parameters:
period- the time period.y- the value for this period.seriesName- the name of the series to add the value.
-
add
Adds a new data item to the dataset.- Parameters:
period- the time period.y- the value for this period.seriesName- the name of the series to add the value.notify- wether dataset listener are notified or not.
-
remove
Removes an existing data item from the dataset.- Parameters:
period- the (existing!) time period of the value to remove.seriesName- the (existing!) series name to remove the value.
-
remove
Removes an existing data item from the dataset.- Parameters:
period- the (existing!) time period of the value to remove.seriesName- the (existing!) series name to remove the value.notify- wether dataset listener are notified or not.
-
getItemCount
public int getItemCount()Returns the number of items every series.- Specified by:
getItemCountin interfaceTableXYDataset- Returns:
- the item count.
-
getItemCount
public int getItemCount(int series)Returns the number of items in a series.- Specified by:
getItemCountin interfaceXYDataset- Parameters:
series- the series (zero-based index).- Returns:
- the number of items within the series.
-
getSeriesCount
public int getSeriesCount()Returns the number of series in the dataset.- Specified by:
getSeriesCountin interfaceSeriesDataset- Specified by:
getSeriesCountin classAbstractSeriesDataset- Returns:
- the series count.
-
getSeriesName
Returns the name of a series.- Specified by:
getSeriesNamein interfaceSeriesDataset- Specified by:
getSeriesNamein classAbstractSeriesDataset- Parameters:
series- the series (zero-based index).- Returns:
- the name of the series.
-
getXValue
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. -
getStartXValue
Returns the starting X value for the specified series and item.- Specified by:
getStartXValuein 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.
-
getEndXValue
Returns the ending X value for the specified series and item.- Specified by:
getEndXValuein 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.
-
getYValue
Returns the y-value for an item within a series. -
getStartYValue
Returns the starting Y value for the specified series and item.- Specified by:
getStartYValuein interfaceIntervalXYDataset- Parameters:
series- the series (zero-based index).item- the item within a series (zero-based index).- Returns:
- starting Y value for the specified series and item.
-
getEndYValue
Returns the ending Y value for the specified series and item.- Specified by:
getEndYValuein 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.
-
getMinimumDomainValue
Returns the minimum value in the dataset (ornullif all the values in the domain arenull).- Specified by:
getMinimumDomainValuein interfaceDomainInfo- Returns:
- The minimum value.
-
getMaximumDomainValue
Returns the maximum value in the dataset (ornullif all the values in the domain arenull).- Specified by:
getMaximumDomainValuein interfaceDomainInfo- Returns:
- The maximum value.
-
getDomainRange
Returns the range of the values in this dataset's domain.- Specified by:
getDomainRangein interfaceDomainInfo- Returns:
- The range.
-
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.
-