java.lang.Object | ||
↳ | org.jfree.data.general.Series | |
↳ | org.jfree.data.xy.XYSeries |
Represents a sequence of zero or more data items in the form (x, y). By
default, items in the series will be sorted into ascending order by x-value,
and duplicate x-values are permitted. Both the sorting and duplicate
defaults can be changed in the constructor. Y-values can be
null
to represent missing values.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
data | Storage for the data items in the series. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new empty series.
| |||||||||||
Constructs a new empty series, with the auto-sort flag set as requested,
and duplicate values allowed.
| |||||||||||
Constructs a new xy-series that contains no data.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a new data item to the series (in the correct position if the
autoSort flag is set for the series) and sends a
SeriesChangeEvent to all registered listeners. | |||||||||||
Adds a data item to the series and, if requested, sends a
SeriesChangeEvent to all registered listeners. | |||||||||||
Adds a data item to the series and, if requested, sends a
SeriesChangeEvent to all registered listeners. | |||||||||||
Adds a 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 data item to the series and sends a
SeriesChangeEvent to
all registered listeners. | |||||||||||
Adds new data to the series and, if requested, sends a
SeriesChangeEvent to all registered listeners. | |||||||||||
Adds a data item to the series and, if requested, sends a
SeriesChangeEvent to all registered listeners. | |||||||||||
Adds or updates an item in the series and sends a
SeriesChangeEvent to all registered listeners. | |||||||||||
Adds or updates an item in the 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 series.
| |||||||||||
Creates a new series by copying a subset of the data in this time series.
| |||||||||||
Deletes a range of items from the series and sends a
SeriesChangeEvent to all registered listeners. | |||||||||||
Tests this series for equality with an arbitrary object.
| |||||||||||
Returns a flag that controls whether duplicate x-values are allowed.
| |||||||||||
Returns the flag that controls whether the items in the series are
automatically sorted.
| |||||||||||
Return the data item with the specified index.
| |||||||||||
Returns the number of items in the series.
| |||||||||||
Returns the list of data items for the series (the list contains
XYDataItem objects and is unmodifiable). | |||||||||||
Returns the largest x-value in the series, ignoring any Double.NaN
values.
| |||||||||||
Returns the largest y-value in the series, ignoring any Double.NaN
values.
| |||||||||||
Returns the maximum number of items that will be retained in the series.
| |||||||||||
Returns the smallest x-value in the series, ignoring any Double.NaN
values.
| |||||||||||
Returns the smallest y-value in the series, ignoring any null and
Double.NaN values.
| |||||||||||
Returns the x-value at the specified index.
| |||||||||||
Returns the y-value at the specified index.
| |||||||||||
Returns a hash code.
| |||||||||||
Returns the index of the item with the specified x-value, or a negative
index if the series does not contain an item with that x-value.
| |||||||||||
Removes an item with the specified x-value and sends a
SeriesChangeEvent to all registered listeners. | |||||||||||
Removes the item at the specified index and sends a
SeriesChangeEvent to all registered listeners. | |||||||||||
Sets the maximum number of items that will be retained in the series.
| |||||||||||
Returns a new array containing the x and y values from this series.
| |||||||||||
Updates an item in the series.
| |||||||||||
This method is deprecated.
Renamed
updateByIndex(int, Number) to avoid
confusion with the update(Number, Number) method.
| |||||||||||
Updates the value of an item in the series and sends a
SeriesChangeEvent to all registered listeners. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Creates a new empty series. By default, items added to the series will be sorted into ascending order by x-value, and duplicate x-values will be allowed (these defaults can be modified with another constructor.
key | the series key (null not permitted).
|
---|
Constructs a new empty series, with the auto-sort flag set as requested, and duplicate values allowed.
key | the series key (null not permitted). |
---|---|
autoSort | a flag that controls whether or not the items in the series are sorted. |
Constructs a new xy-series that contains no data. You can specify whether or not duplicate x-values are allowed for the series.
key | the series key (null not permitted). |
---|---|
autoSort | a flag that controls whether or not the items in the series are sorted. |
allowDuplicateXValues | a flag that controls whether duplicate x-values are allowed. |
Adds a new data item to the series (in the correct position if the
autoSort
flag is set for the series) and sends a
SeriesChangeEvent
to all registered listeners.
Throws an exception if the x-value is a duplicate AND the allowDuplicateXValues flag is false.
x | the x-value (null not permitted). |
---|---|
y | the y-value (null permitted). |
SeriesException | if the x-value is a duplicate and the
allowDuplicateXValues flag is not set for this series.
|
---|
Adds a data item to the series and, if requested, sends a
SeriesChangeEvent
to all registered listeners.
x | the x value. |
---|---|
y | the y value. |
notify | a flag that controls whether or not a
SeriesChangeEvent is sent to all registered
listeners.
|
Adds a data item to the series and, if requested, sends a
SeriesChangeEvent
to all registered listeners.
item | the (x, y) item (null not permitted). |
---|---|
notify | a flag that controls whether or not a
SeriesChangeEvent is sent to all registered
listeners.
|
Adds a data item to the series and sends a SeriesChangeEvent
to
all registered listeners. The unusual pairing of parameter types is to
make it easier to add null
y-values.
x | the x value. |
---|---|
y | the y value (null permitted).
|
Adds a data item to the series and sends a SeriesChangeEvent
to
all registered listeners.
x | the x value. |
---|---|
y | the y value. |
Adds a data item to the series and sends a SeriesChangeEvent
to
all registered listeners.
item | the (x, y) item (null not permitted).
|
---|
Adds new data to the series and, if requested, sends a
SeriesChangeEvent
to all registered listeners.
Throws an exception if the x-value is a duplicate AND the allowDuplicateXValues flag is false.
x | the x-value (null not permitted). |
---|---|
y | the y-value (null permitted). |
notify | a flag the controls whether or not a
SeriesChangeEvent is sent to all registered
listeners.
|
Adds a data item to the series and, if requested, sends a
SeriesChangeEvent
to all registered listeners. The unusual
pairing of parameter types is to make it easier to add null y-values.
x | the x value. |
---|---|
y | the y value (null permitted). |
notify | a flag that controls whether or not a
SeriesChangeEvent is sent to all registered
listeners.
|
Adds or updates an item in the series and sends a
SeriesChangeEvent
to all registered listeners.
x | the x-value (null not permitted). |
---|---|
y | the y-value (null permitted). |
null
if no
item was overwritten.
Adds or updates an item in the series and sends a
SeriesChangeEvent
to all registered listeners.
x | the x-value. |
---|---|
y | the y-value. |
Removes all data items from the series and sends a
SeriesChangeEvent
to all registered listeners.
Returns a clone of the series.
CloneNotSupportedException | if there is a cloning problem. |
---|
Creates a new series by copying a subset of the data in this time series.
start | the index of the first item to copy. |
---|---|
end | the index of the last item to copy. |
CloneNotSupportedException | if there is a cloning problem. |
---|
Deletes a range of items from the series and sends a
SeriesChangeEvent
to all registered listeners.
start | the start index (zero-based). |
---|---|
end | the end index (zero-based). |
Tests this series for equality with an arbitrary object.
obj | the object to test against for equality
(null permitted). |
---|
Returns a flag that controls whether duplicate x-values are allowed. This flag can only be set in the constructor.
Returns the flag that controls whether the items in the series are automatically sorted. There is no setter for this flag, it must be defined in the series constructor.
Return the data item with the specified index.
index | the index. |
---|
Returns the list of data items for the series (the list contains
XYDataItem
objects and is unmodifiable).
Returns the largest x-value in the series, ignoring any Double.NaN values. This method returns Double.NaN if there is no largest x-value (for example, when the series is empty).
Returns the largest y-value in the series, ignoring any Double.NaN values. This method returns Double.NaN if there is no largest y-value (for example, when the series is empty).
Returns the maximum number of items that will be retained in the series.
The default value is Integer.MAX_VALUE
.
Returns the smallest x-value in the series, ignoring any Double.NaN values. This method returns Double.NaN if there is no smallest x-value (for example, when the series is empty).
Returns the smallest y-value in the series, ignoring any null and Double.NaN values. This method returns Double.NaN if there is no smallest y-value (for example, when the series is empty).
Returns the x-value at the specified index.
index | the index (zero-based). |
---|
null
).
Returns the y-value at the specified index.
index | the index (zero-based). |
---|
null
).
Returns a hash code.
Returns the index of the item with the specified x-value, or a negative index if the series does not contain an item with that x-value. Be aware that for an unsorted series, the index is found by iterating through all items in the series.
x | the x-value (null not permitted). |
---|
Removes an item with the specified x-value and sends a
SeriesChangeEvent
to all registered listeners. Note that when
a series permits multiple items with the same x-value, this method
could remove any one of the items with that x-value.
x | the x-value. |
---|
Removes the item at the specified index and sends a
SeriesChangeEvent
to all registered listeners.
index | the index. |
---|
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.
Typically this value is set before the series is populated with data,
but if it is applied later, it may cause some items to be removed from
the series (in which case a SeriesChangeEvent
will be sent to
all registered listeners).
maximum | the maximum number of items for the series. |
---|
Returns a new array containing the x and y values from this series.
Updates an item in the series.
x | the x-value (null not permitted). |
---|---|
y | the y-value (null permitted). |
SeriesException | if there is no existing item with the specified x-value. |
---|
This method is deprecated.
Renamed updateByIndex(int, Number)
to avoid
confusion with the update(Number, Number)
method.
Updates the value of an item in the series and sends a
SeriesChangeEvent
to all registered listeners.
index | the item (zero based index). |
---|---|
y | the new value (null permitted). |
Updates the value of an item in the series and sends a
SeriesChangeEvent
to all registered listeners.
index | the item (zero based index). |
---|---|
y | the new value (null permitted). |