java.lang.Object | ||
↳ | org.jfree.data.general.Series | |
↳ | org.jfree.data.time.TimeSeries |
Represents a sequence of zero or more data items in the form (period, value)
where 'period' is some instance of a subclass of RegularTimePeriod
.
The time series will ensure that (a) all data items have the same type of
period (for example, Day
) and (b) that each period appears at
most one time in the series.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | DEFAULT_DOMAIN_DESCRIPTION | Default value for the domain description. | |||||||||
String | DEFAULT_RANGE_DESCRIPTION | Default value for the range description. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
data | The list of data items in the series. | ||||||||||
timePeriodClass | The type of period for the data. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new (empty) time series.
| |||||||||||
Creates a new time series that contains no data.
| |||||||||||
This constructor is deprecated.
As of 1.0.13, it is not necessary to specify the
timePeriodClass as this will be inferred when the
first data item is added to the dataset.
| |||||||||||
This constructor is deprecated.
As of 1.0.13, it is not necessary to specify the
timePeriodClass as this will be inferred when the
first data item is added to the dataset.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a new data item to the series and sends a
SeriesChangeEvent
to all registered listeners. | |||||||||||
Adds a new data item to the series and sends a
SeriesChangeEvent
to all registered listeners. | |||||||||||
Adds a new data item to the series and sends
a
SeriesChangeEvent to all registered
listeners. | |||||||||||
Adds a data item to the series and sends a
SeriesChangeEvent to
all registered listeners. | |||||||||||
Adds a new data item to the series and sends a
SeriesChangeEvent
to all registered listeners. | |||||||||||
Adds a data item to the series and sends a
SeriesChangeEvent to
all registered listeners. | |||||||||||
Adds or updates data from one series to another.
| |||||||||||
Adds or updates an item in the times series and sends a
SeriesChangeEvent to all registered
listeners. | |||||||||||
Adds or updates an item in the times series and sends a
SeriesChangeEvent to all registered
listeners. | |||||||||||
Removes all data items from the series and sends a
SeriesChangeEvent to all registered listeners. | |||||||||||
Returns a clone of the time series.
| |||||||||||
Creates a new timeseries by copying a subset of the data in this time
series.
| |||||||||||
Creates a new timeseries by copying a subset of the data in this time
series.
| |||||||||||
Deletes data from start until end index (end inclusive).
| |||||||||||
Deletes the data item for the given time period and sends a
SeriesChangeEvent to all registered listeners. | |||||||||||
Tests the series for equality with an arbitrary object.
| |||||||||||
Returns a data item for the series.
| |||||||||||
Returns the data item for a specific period.
| |||||||||||
Returns the domain description.
| |||||||||||
Returns the index for the item (if any) that corresponds to a time
period.
| |||||||||||
Returns the number of items in the series.
| |||||||||||
Returns the list of data items for the series (the list contains
TimeSeriesDataItem objects and is unmodifiable). | |||||||||||
Returns the maximum item age (in time periods) for the series.
| |||||||||||
Returns the maximum number of items that will be retained in the series.
| |||||||||||
Returns a time period that would be the next in sequence on the end of
the time series.
| |||||||||||
Returns the range description.
| |||||||||||
Returns the time period at the specified index.
| |||||||||||
Returns the time period class for this series.
| |||||||||||
Returns a collection of all the time periods in the time series.
| |||||||||||
Returns a collection of time periods in the specified series, but not in
this series, and therefore unique to the specified series.
| |||||||||||
Returns the value at the specified index.
| |||||||||||
Returns the value for a time period.
| |||||||||||
Returns a hash code value for the object.
| |||||||||||
Age items in the series.
| |||||||||||
Age items in the series.
| |||||||||||
Sets the domain description and sends a
PropertyChangeEvent
(with the property name Domain ) to all registered
property change listeners. | |||||||||||
Sets the number of time units in the 'history' for the series.
| |||||||||||
Sets the maximum number of items that will be retained in the series.
| |||||||||||
Sets the range description and sends a
PropertyChangeEvent
(with the property name Range ) to all registered listeners. | |||||||||||
Updates (changes) the value for a time period.
| |||||||||||
Updates (changes) the value of a data item.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Default value for the domain description.
Default value for the range description.
Creates a new (empty) time series. By default, a daily time series is created. Use one of the other constructors if you require a different time period.
name | the series name (null not permitted).
|
---|
Creates a new time series that contains no data.
Descriptions can be specified for the domain and range. One situation where this is helpful is when generating a chart for the time series - axis labels can be taken from the domain and range description.
name | the name of the series (null not permitted). |
---|---|
domain | the domain description (null permitted). |
range | the range description (null permitted). |
This constructor is deprecated.
As of 1.0.13, it is not necessary to specify the
timePeriodClass
as this will be inferred when the
first data item is added to the dataset.
Creates a new (empty) time series with the specified name and class
of RegularTimePeriod
.
name | the series name (null not permitted). |
---|---|
timePeriodClass | the type of time period (null not
permitted). |
This constructor is deprecated.
As of 1.0.13, it is not necessary to specify the
timePeriodClass
as this will be inferred when the
first data item is added to the dataset.
Creates a new time series that contains no data.
Descriptions can be specified for the domain and range. One situation where this is helpful is when generating a chart for the time series - axis labels can be taken from the domain and range description.
name | the name of the series (null not permitted). |
---|---|
domain | the domain description (null permitted). |
range | the range description (null permitted). |
timePeriodClass | the type of time period (null not
permitted). |
Adds a new data item to the series and sends a SeriesChangeEvent
to all registered listeners.
period | the time period (null not permitted). |
---|---|
value | the value. |
Adds a new data item to the series and sends a SeriesChangeEvent
to all registered listeners.
period | the time period (null not permitted). |
---|---|
value | the value. |
notify | notify listeners? |
Adds a new data item to the series and sends
a SeriesChangeEvent
to all registered
listeners.
period | the time period (null not permitted). |
---|---|
value | the value (null permitted).
|
Adds a data item to the series and sends a SeriesChangeEvent
to
all registered listeners.
item | the (timeperiod, value) pair (null not
permitted).
|
---|
Adds a new data item to the series and sends a SeriesChangeEvent
to all registered listeners.
period | the time period (null not permitted). |
---|---|
value | the value (null permitted). |
notify | notify listeners? |
Adds a data item to the series and sends a SeriesChangeEvent
to
all registered listeners.
item | the (timeperiod, value) pair (null not
permitted). |
---|---|
notify | notify listeners? |
Adds or updates data from one series to another. Returns another series containing the values that were overwritten.
series | the series to merge with this. |
---|
Adds or updates an item in the times series and sends a
SeriesChangeEvent
to all registered
listeners.
period | the time period to add/update (null not
permitted). |
---|---|
value | the new value (null permitted). |
null
if no
item was overwritten.
Adds or updates an item in the times series and sends a
SeriesChangeEvent
to all registered
listeners.
period | the time period to add/update (null not
permitted). |
---|---|
value | the new value. |
null
if no
item was overwritten.
Removes all data items from the series and sends a
SeriesChangeEvent
to all registered listeners.
Returns a clone of the time series.
Notes:
CloneNotSupportedException | not thrown by this class, but subclasses may differ. |
---|
Creates a new timeseries by copying a subset of the data in this time series.
start | the index of the first time period to copy. |
---|---|
end | the index of the last time period to copy. |
CloneNotSupportedException | if there is a cloning problem. |
---|
Creates a new timeseries by copying a subset of the data in this time series.
start | the first time period to copy (null not
permitted). |
---|---|
end | the last time period to copy (null not
permitted). |
CloneNotSupportedException | if there is a cloning problem. |
---|
Deletes data from start until end index (end inclusive).
start | the index of the first period to delete. |
---|---|
end | the index of the last period to delete. |
Deletes the data item for the given time period and sends a
SeriesChangeEvent
to all registered listeners. If there is no
item with the specified time period, this method does nothing.
period | the period of the item to delete (null not
permitted).
|
---|
Tests the series for equality with an arbitrary object.
object | the object to test against (null permitted). |
---|
Returns a data item for the series.
index | the item index (zero-based). |
---|
Returns the data item for a specific period.
period | the period of interest (null not allowed). |
---|
null
if there is no match).Returns the domain description.
null
).Returns the index for the item (if any) that corresponds to a time period.
period | the time period (null not permitted). |
---|
Returns the number of items in the series.
Returns the list of data items for the series (the list contains
TimeSeriesDataItem
objects and is unmodifiable).
Returns the maximum item age (in time periods) for the series.
Returns the maximum number of items that will be retained in the series.
The default value is Integer.MAX_VALUE
.
Returns a time period that would be the next in sequence on the end of the time series.
Returns the range description.
null
).Returns the time period at the specified index.
index | the index of the data item. |
---|
Returns the time period class for this series.
Only one time period class can be used within a single series (enforced).
If you add a data item with a Year
for the time period, then all
subsequent data items must also have a Year
for the time period.
null
but only for
an empty series).
Returns a collection of all the time periods in the time series.
Returns a collection of time periods in the specified series, but not in this series, and therefore unique to the specified series.
series | the series to check against this one. |
---|
Returns the value at the specified index.
index | index of a value. |
---|
null
).
Returns the value for a time period. If there is no data item with the
specified period, this method will return null
.
period | time period (null not permitted). |
---|
null
).
Returns a hash code value for the object.
Age items in the series. Ensure that the timespan from the youngest to the oldest record in the series does not exceed maximumItemAge time periods. Oldest items will be removed if required.
notify | controls whether or not a SeriesChangeEvent is
sent to registered listeners IF any items are removed.
|
---|
Age items in the series. Ensure that the timespan from the supplied time to the oldest record in the series does not exceed history count. oldest items will be removed if required.
latest | the time to be compared against when aging data (specified in milliseconds). |
---|---|
notify | controls whether or not a SeriesChangeEvent is
sent to registered listeners IF any items are removed.
|
Sets the domain description and sends a PropertyChangeEvent
(with the property name Domain
) to all registered
property change listeners.
description | the description (null permitted). |
---|
Sets the number of time units in the 'history' for the series. This provides one mechanism for automatically dropping old data from the time series. For example, if a series contains daily data, you might set the history count to 30. Then, when you add a new data item, all data items more than 30 days older than the latest value are automatically dropped from the series.
periods | the number of time periods. |
---|
Sets the maximum number of items that will be retained in the series. If you add a new item to the series such that the number of items will exceed the maximum item count, then the FIRST element in the series is automatically removed, ensuring that the maximum item count is not exceeded.
maximum | the maximum (requires >= 0). |
---|
Sets the range description and sends a PropertyChangeEvent
(with the property name Range
) to all registered listeners.
description | the description (null permitted). |
---|
Updates (changes) the value for a time period. Throws a
SeriesException
if the period does not exist.
period | the period (null not permitted). |
---|---|
value | the value (null permitted).
|
Updates (changes) the value of a data item.
index | the index of the data item. |
---|---|
value | the new value (null permitted).
|