public class XYTaskDataset extends AbstractXYDataset implements IntervalXYDataset, DatasetChangeListener
TaskSeriesCollection and
presents it as an IntervalXYDataset, allowing a set of tasks to
be displayed using an XYBarRenderer (and usually a
SymbolAxis). This is a very specialised dataset implementation
---before using it, you should take some time to understand the use-cases
that it is designed for.| Modifier and Type | Field and Description |
|---|---|
private double |
seriesWidth
The series interval width (typically 0.0 < w <= 1.0).
|
private boolean |
transposed
A flag that controls whether or not the data values are transposed.
|
private TaskSeriesCollection |
underlying
The underlying tasks.
|
| Constructor and Description |
|---|
XYTaskDataset(TaskSeriesCollection tasks)
Creates a new dataset based on the supplied collection of tasks.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone()
Returns a clone of this dataset.
|
void |
datasetChanged(DatasetChangeEvent event)
Receives a change event from the underlying dataset and responds by
firing a change event for this dataset.
|
boolean |
equals(java.lang.Object obj)
Tests this dataset for equality with an arbitrary object.
|
java.lang.Number |
getEndX(int series,
int item)
Returns the ending date/time for the specified item (task) in the
given series, measured in milliseconds since 1-Jan-1970 (as in
java.util.Date).
|
double |
getEndXValue(int series,
int item)
Returns the ending date/time for the specified item (task) in the
given series, measured in milliseconds since 1-Jan-1970 (as in
java.util.Date).
|
java.lang.Number |
getEndY(int series,
int item)
Returns the ending value of the y-interval for an item in the
given series.
|
double |
getEndYValue(int series,
int item)
Returns the ending value of the y-interval for an item in the
given series.
|
int |
getItemCount(int series)
Returns the number of items (tasks) in the specified series.
|
private double |
getItemEndValue(int series,
int item) |
private double |
getItemStartValue(int series,
int item) |
private double |
getItemValue(int series,
int item) |
int |
getSeriesCount()
Returns the number of series in the dataset.
|
private double |
getSeriesEndValue(int series) |
java.lang.Comparable |
getSeriesKey(int series)
Returns the name of a series.
|
private double |
getSeriesStartValue(int series) |
private double |
getSeriesValue(int series) |
double |
getSeriesWidth()
Returns the width of the interval for each series this dataset.
|
java.lang.Number |
getStartX(int series,
int item)
Returns the starting date/time for the specified item (task) in the
given series, measured in milliseconds since 1-Jan-1970 (as in
java.util.Date).
|
double |
getStartXValue(int series,
int item)
Returns the starting date/time for the specified item (task) in the
given series, measured in milliseconds since 1-Jan-1970 (as in
java.util.Date).
|
java.lang.Number |
getStartY(int series,
int item)
Returns the starting value of the y-interval for an item in the
given series.
|
double |
getStartYValue(int series,
int item)
Returns the starting value of the y-interval for an item in the
given series.
|
TaskSeriesCollection |
getTasks()
Returns the underlying task series collection that was supplied to the
constructor.
|
java.lang.Number |
getX(int series,
int item)
Returns the x-value for the specified series.
|
double |
getXValue(int series,
int item)
Returns the x-value (as a double primitive) for an item within a series.
|
java.lang.Number |
getY(int series,
int item)
Returns the y-value for the specified series/item.
|
double |
getYValue(int series,
int item)
Returns the y-value (as a double primitive) for an item within a series.
|
boolean |
isTransposed()
Returns a flag that indicates whether or not the dataset is transposed.
|
void |
setSeriesWidth(double w)
Sets the series interval width and sends a
DatasetChangeEvent to
all registered listeners. |
void |
setTransposed(boolean transposed)
Sets the flag that controls whether or not the dataset is transposed
and sends a
DatasetChangeEvent to all registered listeners. |
getDomainOrderindexOf, seriesChangedaddChangeListener, fireDatasetChanged, getGroup, getNotify, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObjectfinalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDomainOrderindexOfaddChangeListener, getGroup, removeChangeListener, setGroupprivate TaskSeriesCollection underlying
private double seriesWidth
private boolean transposed
public XYTaskDataset(TaskSeriesCollection tasks)
tasks - the underlying dataset (null not permitted).public TaskSeriesCollection getTasks()
null).public double getSeriesWidth()
setSeriesWidth(double)public void setSeriesWidth(double w)
DatasetChangeEvent to
all registered listeners.w - the width.getSeriesWidth()public boolean isTransposed()
false which means the x-values are integers
corresponding to the series indices, and the y-values are millisecond
values corresponding to the task date/time intervals. If the flag
is set to true, the x and y-values are reversed.setTransposed(boolean)public void setTransposed(boolean transposed)
DatasetChangeEvent to all registered listeners.transposed - the new flag value.isTransposed()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 index (zero-based).public int getItemCount(int series)
getItemCount in interface XYDatasetseries - the series index (zero-based).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 double getStartXValue(int series,
int item)
getStartXValue in interface IntervalXYDatasetseries - the series index.item - the item (or task) index.IntervalXYDataset.getStartX(int, int)public double getEndXValue(int series,
int item)
getEndXValue in interface IntervalXYDatasetseries - the series index.item - the item (or task) index.IntervalXYDataset.getEndX(int, int)public java.lang.Number getX(int series,
int item)
public java.lang.Number getStartX(int series,
int item)
getStartX in interface IntervalXYDatasetseries - the series index.item - the item (or task) index.public java.lang.Number getEndX(int series,
int item)
getEndX in interface IntervalXYDatasetseries - the series index.item - the item (or task) index.public double getYValue(int series,
int item)
getYValue in interface XYDatasetgetYValue in class AbstractXYDatasetseries - the series index (zero-based).item - the item index (zero-based).public double getStartYValue(int series,
int item)
getStartYValue in interface IntervalXYDatasetseries - the series index.item - the item (or task) index.IntervalXYDataset.getStartY(int, int)public double getEndYValue(int series,
int item)
getEndYValue in interface IntervalXYDatasetseries - the series index.item - the item (or task) index.IntervalXYDataset.getEndY(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 index.item - the item (or task) index.public java.lang.Number getEndY(int series,
int item)
getEndY in interface IntervalXYDatasetseries - the series index.item - the item (or task) index.private double getSeriesValue(int series)
private double getSeriesStartValue(int series)
private double getSeriesEndValue(int series)
private double getItemValue(int series,
int item)
private double getItemStartValue(int series,
int item)
private double getItemEndValue(int series,
int item)
public void datasetChanged(DatasetChangeEvent event)
datasetChanged in interface DatasetChangeListenerevent - the event.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 class AbstractDatasetjava.lang.CloneNotSupportedException - if there is a problem cloning.