public class TimeTableXYDataset extends AbstractIntervalXYDataset implements java.lang.Cloneable, org.jfree.util.PublicCloneable, IntervalXYDataset, DomainInfo, TableXYDataset
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.TableXYDataset,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
private boolean |
domainIsPointsInTime
A flag that indicates that the domain is 'points in time'.
|
private DefaultKeyedValues2D |
values
The data structure to store the values.
|
private java.util.Calendar |
workingCalendar
A working calendar (to recycle)
|
private TimePeriodAnchor |
xPosition
The point within each time period that is used for the X value when this
collection is used as an
XYDataset. |
| Constructor and Description |
|---|
TimeTableXYDataset()
Creates a new dataset.
|
TimeTableXYDataset(java.util.TimeZone zone)
Creates a new dataset with the given time zone.
|
TimeTableXYDataset(java.util.TimeZone zone,
java.util.Locale locale)
Creates a new dataset with the given time zone and locale.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(TimePeriod period,
double y,
java.lang.Comparable seriesName)
Adds a new data item to the dataset and sends a
DatasetChangeEvent to all registered listeners. |
void |
add(TimePeriod period,
java.lang.Number y,
java.lang.Comparable seriesName,
boolean notify)
Adds a new data item to the dataset and, if requested, sends a
DatasetChangeEvent to all registered listeners. |
void |
clear()
Removes all data items from the dataset and sends a
DatasetChangeEvent to all registered listeners. |
java.lang.Object |
clone()
Returns a clone of this dataset.
|
boolean |
equals(java.lang.Object obj)
Tests this dataset for equality with an arbitrary object.
|
Range |
getDomainBounds(boolean includeInterval)
Returns the range of the values in this dataset's domain.
|
boolean |
getDomainIsPointsInTime()
Returns a flag that controls whether the domain is treated as 'points in
time'.
|
double |
getDomainLowerBound(boolean includeInterval)
Returns the minimum x-value in the dataset.
|
double |
getDomainUpperBound(boolean includeInterval)
Returns the maximum x-value in the dataset.
|
java.lang.Number |
getEndX(int series,
int item)
Returns the ending X value for the specified series and item.
|
double |
getEndXValue(int series,
int item)
Returns the end x-value (as a double primitive) for an item within
a series.
|
java.lang.Number |
getEndY(int series,
int item)
Returns the ending Y value for the specified series and item.
|
int |
getItemCount()
Returns the number of items in ALL series.
|
int |
getItemCount(int series)
Returns the number of items in a series.
|
int |
getSeriesCount()
Returns the number of series in the dataset.
|
java.lang.Comparable |
getSeriesKey(int series)
Returns the key for a series.
|
java.lang.Number |
getStartX(int series,
int item)
Returns the starting X value for the specified series and item.
|
double |
getStartXValue(int series,
int item)
Returns the start x-value (as a double primitive) for an item within
a series.
|
java.lang.Number |
getStartY(int series,
int item)
Returns the starting Y value for the specified series and item.
|
TimePeriod |
getTimePeriod(int item)
Returns the time period for the specified item.
|
java.lang.Number |
getX(int series,
int item)
Returns the x-value for an item within a series.
|
TimePeriodAnchor |
getXPosition()
Returns the position within each time period that is used for the X
value.
|
double |
getXValue(int series,
int item)
Returns the x-value (as a double primitive) for an item within a series.
|
private long |
getXValue(TimePeriod period)
Returns the x-value for a time period.
|
java.lang.Number |
getY(int series,
int item)
Returns the y-value for an item within a series.
|
void |
remove(TimePeriod period,
java.lang.Comparable seriesName)
Removes an existing data item from the dataset.
|
void |
remove(TimePeriod period,
java.lang.Comparable seriesName,
boolean notify)
Removes an existing data item from the dataset and, if requested,
sends a
DatasetChangeEvent to all registered listeners. |
void |
setDomainIsPointsInTime(boolean flag)
Sets a flag that controls whether the domain is treated as 'points in
time', or time periods.
|
void |
setXPosition(TimePeriodAnchor anchor)
Sets the position within each time period that is used for the X values,
then sends a
DatasetChangeEvent to all registered listeners. |
getEndYValue, getStartYValuegetDomainOrder, getYValueindexOf, seriesChangedaddChangeListener, fireDatasetChanged, getGroup, getNotify, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObjectfinalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetEndYValue, getStartYValuegetDomainOrder, getYValueindexOfaddChangeListener, getGroup, removeChangeListener, setGroupprivate DefaultKeyedValues2D values
RegularTimePeriod (the rows are sorted into ascending order).private boolean domainIsPointsInTime
private TimePeriodAnchor xPosition
XYDataset. This can
be the start, middle or end of the time period.private java.util.Calendar workingCalendar
public TimeTableXYDataset()
public TimeTableXYDataset(java.util.TimeZone zone)
zone - the time zone to use (null not permitted).public TimeTableXYDataset(java.util.TimeZone zone,
java.util.Locale locale)
zone - the time zone to use (null not permitted).locale - the locale to use (null not permitted).public boolean getDomainIsPointsInTime()
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.
setDomainIsPointsInTime(boolean)public void setDomainIsPointsInTime(boolean flag)
DatasetChangeEvent is sent to all
registered listeners.flag - the new value of the flag.getDomainIsPointsInTime()public TimePeriodAnchor getXPosition()
null).setXPosition(TimePeriodAnchor)public void setXPosition(TimePeriodAnchor anchor)
DatasetChangeEvent to all registered listeners.anchor - the anchor position (null not permitted).getXPosition()public void add(TimePeriod period, double y, java.lang.Comparable seriesName)
DatasetChangeEvent to all registered listeners.period - the time period.y - the value for this period.seriesName - the name of the series to add the value.remove(TimePeriod, Comparable)public void add(TimePeriod period, java.lang.Number y, java.lang.Comparable seriesName, boolean notify)
DatasetChangeEvent to all registered listeners.period - the time period (null not permitted).y - the value for this period (null permitted).seriesName - the name of the series to add the value
(null not permitted).notify - whether dataset listener are notified or not.remove(TimePeriod, Comparable, boolean)public void remove(TimePeriod period, java.lang.Comparable seriesName)
period - the (existing!) time period of the value to remove
(null not permitted).seriesName - the (existing!) series name to remove the value
(null not permitted).add(TimePeriod, double, Comparable)public void remove(TimePeriod period, java.lang.Comparable seriesName, boolean notify)
DatasetChangeEvent to all registered listeners.period - the (existing!) time period of the value to remove
(null not permitted).seriesName - the (existing!) series name to remove the value
(null not permitted).notify - whether dataset listener are notified or not.add(TimePeriod, double, Comparable)public void clear()
DatasetChangeEvent to all registered listeners.public TimePeriod getTimePeriod(int item)
item - the item index (0 <= i <= getItemCount()).public int getItemCount()
getItemCount in interface TableXYDatasetpublic int getItemCount(int series)
getItemCount() since all series
share the same x-values (time periods).getItemCount in interface XYDatasetseries - the series (zero-based index, ignored).public int getSeriesCount()
getSeriesCount in interface SeriesDatasetgetSeriesCount in class AbstractSeriesDatasetpublic java.lang.Comparable getSeriesKey(int series)
getSeriesKey in interface SeriesDatasetgetSeriesKey in class AbstractSeriesDatasetseries - the series (zero-based index).public java.lang.Number getX(int series,
int item)
public double getXValue(int series,
int item)
getXValue in interface XYDatasetgetXValue in class AbstractXYDatasetseries - the series index (zero-based).item - the item index (zero-based).public java.lang.Number getStartX(int series,
int item)
getStartX in interface IntervalXYDatasetseries - the series (zero-based index).item - the item within a series (zero-based index).getStartXValue(int, int)public double getStartXValue(int series,
int item)
getStartXValue in interface IntervalXYDatasetgetStartXValue in class AbstractIntervalXYDatasetseries - the series index (zero-based).item - the item index (zero-based).IntervalXYDataset.getStartX(int, int)public java.lang.Number getEndX(int series,
int item)
getEndX in interface IntervalXYDatasetseries - the series (zero-based index).item - the item within a series (zero-based index).getEndXValue(int, int)public double getEndXValue(int series,
int item)
getEndXValue in interface IntervalXYDatasetgetEndXValue in class AbstractIntervalXYDatasetseries - the series index (zero-based).item - the item index (zero-based).IntervalXYDataset.getEndX(int, int)public java.lang.Number getY(int series,
int item)
public java.lang.Number getStartY(int series,
int item)
getStartY in interface IntervalXYDatasetseries - the series (zero-based index).item - the item within a series (zero-based index).public java.lang.Number getEndY(int series,
int item)
getEndY in interface IntervalXYDatasetseries - the series (zero-based index).item - the item within a series (zero-based index).private long getXValue(TimePeriod period)
period - the time period.public double getDomainLowerBound(boolean includeInterval)
getDomainLowerBound in interface DomainInfoincludeInterval - a flag that determines whether or not the
x-interval is taken into account.public double getDomainUpperBound(boolean includeInterval)
getDomainUpperBound in interface DomainInfoincludeInterval - a flag that determines whether or not the
x-interval is taken into account.public Range getDomainBounds(boolean includeInterval)
getDomainBounds in interface DomainInfoincludeInterval - a flag that controls whether or not the
x-intervals are taken into account.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object (null permitted).public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface org.jfree.util.PublicCloneableclone in class AbstractDatasetjava.lang.CloneNotSupportedException - if the dataset cannot be cloned.