org.jfree.data.xy
public class XYSeries extends Series implements Cloneable, Serializable
null
to represent missing values.
Field Summary | |
---|---|
protected List | data Storage for the data items in the series. |
Constructor Summary | |
---|---|
XYSeries(Comparable key)
Creates a new empty series. | |
XYSeries(Comparable key, boolean autoSort)
Constructs a new empty series, with the auto-sort flag set as requested,
and duplicate values allowed.
| |
XYSeries(Comparable key, boolean autoSort, boolean allowDuplicateXValues)
Constructs a new xy-series that contains no data. |
Method Summary | |
---|---|
void | add(XYDataItem item)
Adds a data item to the series and sends a SeriesChangeEvent to
all registered listeners.
|
void | add(double x, double y)
Adds a data item to the series and sends a SeriesChangeEvent to
all registered listeners.
|
void | add(double x, double y, boolean notify)
Adds a data item to the series and, if requested, sends a
SeriesChangeEvent to all registered listeners.
|
void | add(double x, Number y)
Adds a data item to the series and sends a SeriesChangeEvent to
all registered listeners. |
void | add(double x, Number y, boolean notify)
Adds a data item to the series and, if requested, sends a
SeriesChangeEvent to all registered listeners. |
void | add(Number x, Number y)
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.
|
void | add(Number x, Number y, boolean notify)
Adds new data to the series and, if requested, sends a
SeriesChangeEvent to all registered listeners.
|
void | add(XYDataItem item, boolean notify)
Adds a data item to the series and, if requested, sends a
SeriesChangeEvent to all registered listeners.
|
XYDataItem | addOrUpdate(double x, double y)
Adds or updates an item in the series and sends a
SeriesChangeEvent to all registered listeners.
|
XYDataItem | addOrUpdate(Number x, Number y)
Adds or updates an item in the series and sends a
SeriesChangeEvent to all registered listeners.
|
void | clear()
Removes all data items from the series and sends a
SeriesChangeEvent to all registered listeners. |
Object | clone()
Returns a clone of the series.
|
XYSeries | createCopy(int start, int end)
Creates a new series by copying a subset of the data in this time series.
|
void | delete(int start, int end)
Deletes a range of items from the series and sends a
SeriesChangeEvent to all registered listeners.
|
boolean | equals(Object obj)
Tests this series for equality with an arbitrary object.
|
boolean | getAllowDuplicateXValues()
Returns a flag that controls whether duplicate x-values are allowed.
|
boolean | getAutoSort()
Returns the flag that controls whether the items in the series are
automatically sorted. |
XYDataItem | getDataItem(int index)
Return the data item with the specified index.
|
int | getItemCount()
Returns the number of items in the series.
|
List | getItems()
Returns the list of data items for the series (the list contains
XYDataItem objects and is unmodifiable).
|
int | getMaximumItemCount()
Returns the maximum number of items that will be retained in the series.
|
double | getMaxX()
Returns the largest x-value in the series, ignoring any Double.NaN
values. |
double | getMaxY()
Returns the largest y-value in the series, ignoring any Double.NaN
values. |
double | getMinX()
Returns the smallest x-value in the series, ignoring any Double.NaN
values. |
double | getMinY()
Returns the smallest y-value in the series, ignoring any null and
Double.NaN values. |
Number | getX(int index)
Returns the x-value at the specified index.
|
Number | getY(int index)
Returns the y-value at the specified index.
|
int | hashCode()
Returns a hash code.
|
int | indexOf(Number x)
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. |
XYDataItem | remove(int index)
Removes the item at the specified index and sends a
SeriesChangeEvent to all registered listeners.
|
XYDataItem | remove(Number x)
Removes an item with the specified x-value and sends a
SeriesChangeEvent to all registered listeners. |
void | setMaximumItemCount(int maximum)
Sets the maximum number of items that will be retained in the series.
|
double[][] | toArray()
Returns a new array containing the x and y values from this series.
|
void | update(int index, Number y)
Updates the value of an item in the series and sends a
SeriesChangeEvent to all registered listeners.
|
void | update(Number x, Number y)
Updates an item in the series.
|
void | updateByIndex(int index, Number y)
Updates the value of an item in the series and sends a
SeriesChangeEvent to all registered listeners.
|
Parameters: key the series key (null
not permitted).
Parameters: key the series key (null
not permitted). autoSort a flag that controls whether or not the items in the
series are sorted.
Parameters: 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.
Parameters: item the (x, y) item (null
not permitted).
Parameters: x the x value. y the y value.
Parameters: x the x value. y the y value. notify a flag that controls whether or not a SeriesChangeEvent is sent to all registered listeners.
null
y-values.
Parameters: x the x value. y the y value (null
permitted).
Parameters: 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.
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.
Parameters: x the x-value (null
not permitted). y the y-value (null
permitted).
Throws: SeriesException if the x-value is a duplicate and the
allowDuplicateXValues
flag is not set for this series.
Throws an exception if the x-value is a duplicate AND the allowDuplicateXValues flag is false.
Parameters: 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.
Parameters: item the (x, y) item (null
not permitted). notify a flag that controls whether or not a
SeriesChangeEvent is sent to all registered
listeners.
Parameters: x the x-value. y the y-value.
Returns: The item that was overwritten, if any.
Since: 1.0.10
Parameters: x the x-value (null
not permitted). y the y-value (null
permitted).
Returns: A copy of the overwritten data item, or null
if no
item was overwritten.
Returns: A clone of the series.
Throws: CloneNotSupportedException if there is a cloning problem.
Parameters: start the index of the first item to copy. end the index of the last item to copy.
Returns: A series containing a copy of this series from start until end.
Throws: CloneNotSupportedException if there is a cloning problem.
Parameters: start the start index (zero-based). end the end index (zero-based).
Parameters: obj the object to test against for equality
(null
permitted).
Returns: A boolean.
Returns: A boolean.
Returns: A boolean.
Parameters: index the index.
Returns: The data item with the specified index.
Returns: The item count.
See Also: getItems
Returns: The list of data items.
Integer.MAX_VALUE
.
Returns: The maximum item count.
See Also: XYSeries
Returns: The largest x-value.
Since: 1.0.13
Returns: The largest y-value.
Since: 1.0.13
Returns: The smallest x-value.
Since: 1.0.13
Returns: The smallest y-value.
Since: 1.0.13
Parameters: index the index (zero-based).
Returns: The x-value (never null
).
Parameters: index the index (zero-based).
Returns: The y-value (possibly null
).
Returns: A hash code.
Parameters: x the x-value (null
not permitted).
Returns: The index.
Parameters: index the index.
Returns: The item removed.
Parameters: x the x-value.
Returns: The item removed.
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).
Parameters: maximum the maximum number of items for the series.
Returns: A new array containing the x and y values from this series.
Since: 1.0.4
Deprecated: Renamed XYSeries to avoid confusion with the XYSeries method.
Updates the value of an item in the series and sends a SeriesChangeEvent to all registered listeners.Parameters: index the item (zero based index). y the new value (null
permitted).
Parameters: x the x-value (null
not permitted). y the y-value (null
permitted).
Throws: SeriesException if there is no existing item with the specified x-value.
Parameters: index the item (zero based index). y the new value (null
permitted).
Since: 1.0.1