|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.jrefinery.data.AbstractDataset
com.jrefinery.data.AbstractSeriesDataset
com.jrefinery.data.TimeSeriesCollection
public class TimeSeriesCollection
A collection of time series objects.
This class implements the IntervalXYDataset interface. One consequence of this is that this class can be used quite easily to supply data to JFreeChart.
| Field Summary | |
|---|---|
protected java.util.List |
data
Storage for the time series. |
static int |
END
Useful constant for controlling the x-value returned for a time period. |
static int |
MIDDLE
Useful constant for controlling the x-value returned for a time period. |
protected int |
position
|
static int |
START
Useful constant for controlling the x-value returned for a time period. |
protected java.util.Calendar |
workingCalendar
A working calendar (to recycle) |
| Fields inherited from class com.jrefinery.data.AbstractDataset |
|---|
listeners |
| Constructor Summary | |
|---|---|
TimeSeriesCollection()
Constructs an empty dataset, tied to the default timezone. |
|
TimeSeriesCollection(BasicTimeSeries series)
Constructs a dataset containing a single series (more can be added), tied to the default timezone. |
|
TimeSeriesCollection(BasicTimeSeries series,
java.util.TimeZone zone)
Constructs a dataset containing a single series (more can be added), tied to a specific timezone. |
|
TimeSeriesCollection(java.util.TimeZone zone)
Constructs an empty dataset, tied to a specific timezone. |
|
| Method Summary | |
|---|---|
void |
addSeries(BasicTimeSeries series)
Adds a series to the collection. |
java.lang.Number |
getEndXValue(int series,
int item)
Returns the ending X value for the specified series and item. |
java.lang.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. |
int |
getPosition()
Returns the position of the x-value returned for a time period (START, MIDDLE, or END). |
BasicTimeSeries |
getSeries(int series)
Returns a series. |
int |
getSeriesCount()
Returns the number of series in the collection. |
java.lang.String |
getSeriesName(int series)
Returns the name of a series. |
java.lang.Number |
getStartXValue(int series,
int item)
Returns the starting X value for the specified series and item. |
java.lang.Number |
getStartYValue(int series,
int item)
Returns the starting Y value for the specified series and item. |
java.lang.Number |
getXValue(int series,
int item)
Returns the x-value for the specified series and item. |
java.lang.Number |
getYValue(int series,
int item)
Returns the y-value for the specified series and item. |
void |
setPosition(int position)
Sets the position - this controls the x-value that is returned for a particular time period. |
| Methods inherited from class com.jrefinery.data.AbstractSeriesDataset |
|---|
getLegendItemCount, getLegendItemLabels, seriesChanged |
| Methods inherited from class com.jrefinery.data.AbstractDataset |
|---|
addChangeListener, fireDatasetChanged, notifyListeners, removeChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.jrefinery.data.Dataset |
|---|
addChangeListener, removeChangeListener |
| Field Detail |
|---|
public static final int START
public static final int MIDDLE
public static final int END
protected java.util.List data
protected java.util.Calendar workingCalendar
protected int position
| Constructor Detail |
|---|
public TimeSeriesCollection()
public TimeSeriesCollection(java.util.TimeZone zone)
zone - The timezone.public TimeSeriesCollection(BasicTimeSeries series)
series - The series.
public TimeSeriesCollection(BasicTimeSeries series,
java.util.TimeZone zone)
series - The series.zone - The timezone.| Method Detail |
|---|
public int getPosition()
public void setPosition(int position)
Use the constants START, MIDDLE and END.
position - The position.public int getSeriesCount()
getSeriesCount in interface SeriesDatasetgetSeriesCount in class AbstractSeriesDatasetpublic BasicTimeSeries getSeries(int series)
series - The index of the series (zero-based).
public java.lang.String getSeriesName(int series)
This method is provided for convenience.
getSeriesName in interface SeriesDatasetgetSeriesName in class AbstractSeriesDatasetseries - The index of the series (zero-based).
public void addSeries(BasicTimeSeries series)
Notifies all registered listeners that the dataset has changed.
series - The time series.public int getItemCount(int series)
This method is provided for convenience.
getItemCount in interface XYDatasetseries - The index of the series of interest (zero-based).
public java.lang.Number getXValue(int series,
int item)
getXValue in interface XYDatasetseries - The series (zero-based index).item - The item (zero-based index).
public java.lang.Number getStartXValue(int series,
int item)
getStartXValue in interface IntervalXYDatasetseries - The series (zero-based index).item - The item (zero-based index).
public java.lang.Number getEndXValue(int series,
int item)
getEndXValue in interface IntervalXYDatasetseries - The series (zero-based index).item - The item (zero-based index).
public java.lang.Number getYValue(int series,
int item)
getYValue in interface XYDatasetseries - The series (zero-based index).item - The item (zero-based index).
public java.lang.Number getStartYValue(int series,
int item)
getStartYValue in interface IntervalXYDatasetseries - The series (zero-based index).item - The item (zero-based index).
public java.lang.Number getEndYValue(int series,
int item)
getEndYValue in interface IntervalXYDatasetseries - The series (zero-based index).item - The item (zero-based index).
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||