Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.jfree.data.general.Series
org.jfree.data.xy.XYSeries
null
to represent missing values.
Field Summary | |
protected List |
|
Constructor Summary | |
| |
| |
|
Method Summary | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
XYDataItem |
|
void |
|
Object |
|
XYSeries |
|
void |
|
boolean |
|
boolean |
|
boolean |
|
XYDataItem |
|
int |
|
List |
|
int |
|
Number |
|
Number |
|
int |
|
int |
|
XYDataItem |
|
XYDataItem |
|
void |
|
double[][] |
|
void |
|
void |
|
void |
|
Methods inherited from class org.jfree.data.general.Series | |
addChangeListener , addPropertyChangeListener , clone , equals , firePropertyChange , fireSeriesChanged , getDescription , getKey , getNotify , hashCode , notifyListeners , removeChangeListener , removePropertyChangeListener , setDescription , setKey , setNotify |
public XYSeries(Comparable key)
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.
- Parameters:
key
- the series key (null
not permitted).
public XYSeries(Comparable key, boolean autoSort)
Constructs a new empty series, with the auto-sort flag set as requested, and duplicate values allowed.
- Parameters:
key
- the series key (null
not permitted).autoSort
- a flag that controls whether or not the items in the series are sorted.
public XYSeries(Comparable key, boolean autoSort, boolean allowDuplicateXValues)
Constructs a new xy-series that contains no data. You can specify whether or not duplicate x-values are allowed for the series.
- 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.
public void add(Number x, Number y)
Adds new data to the series and sends aSeriesChangeEvent
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).
public void add(Number x, Number y, boolean notify)
Adds new data to the series and, if requested, sends aSeriesChangeEvent
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).notify
- a flag the controls whether or not aSeriesChangeEvent
is sent to all registered listeners.
public void add(double x, Number y)
Adds a data item to the series and sends aSeriesChangeEvent
to all registered listeners. The unusual pairing of parameter types is to make it easier to addnull
y-values.
- Parameters:
x
- the x value.y
- the y value (null
permitted).
public void add(double x, Number y, boolean notify)
Adds a data item to the series and, if requested, sends aSeriesChangeEvent
to all registered listeners. The unusual pairing of parameter types is to make it easier to add null y-values.
- Parameters:
x
- the x value.y
- the y value (null
permitted).notify
- a flag that controls whether or not aSeriesChangeEvent
is sent to all registered listeners.
public void add(double x, double y)
Adds a data item to the series and sends aSeriesChangeEvent
to all registered listeners.
- Parameters:
x
- the x value.y
- the y value.
public void add(double x, double y, boolean notify)
Adds a data item to the series and, if requested, sends aSeriesChangeEvent
to all registered listeners.
- Parameters:
x
- the x value.y
- the y value.notify
- a flag that controls whether or not aSeriesChangeEvent
is sent to all registered listeners.
public void add(XYDataItem item)
Adds a data item to the series and sends aSeriesChangeEvent
to all registered listeners.
- Parameters:
item
- the (x, y) item (null
not permitted).
public void add(XYDataItem item, boolean notify)
Adds a data item to the series and, if requested, sends aSeriesChangeEvent
to all registered listeners.
- Parameters:
item
- the (x, y) item (null
not permitted).notify
- a flag that controls whether or not aSeriesChangeEvent
is sent to all registered listeners.
public XYDataItem addOrUpdate(Number x, Number y)
Adds or updates an item in the series and sends aSeriesChangeEvent
to all registered listeners.
- 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.
public Object clone() throws CloneNotSupportedException
Returns a clone of the series.
- Returns:
- A clone of the time series.
public XYSeries createCopy(int start, int end) throws CloneNotSupportedException
Creates a new series by copying a subset of the data in this time series.
- 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.
public void delete(int start, int end)
Deletes a range of items from the series and sends aSeriesChangeEvent
to all registered listeners.
- Parameters:
start
- the start index (zero-based).end
- the end index (zero-based).
public boolean equals(Object obj)
Tests this series for equality with an arbitrary object.
- Parameters:
obj
- the object to test against for equality (null
permitted).
- Returns:
- A boolean.
public boolean getAllowDuplicateXValues()
Returns a flag that controls whether duplicate x-values are allowed. This flag can only be set in the constructor.
- Returns:
- A boolean.
public boolean getAutoSort()
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.
- Returns:
- A boolean.
public XYDataItem getDataItem(int index)
Return the data item with the specified index.
- Parameters:
index
- the index.
- Returns:
- The data item with the specified index.
public int getItemCount()
Returns the number of items in the series.
- Returns:
- The item count.
public List getItems()
Returns the list of data items for the series (the list containsXYDataItem
objects and is unmodifiable).
- Returns:
- The list of data items.
public int getMaximumItemCount()
Returns the maximum number of items that will be retained in the series. The default value isInteger.MAX_VALUE
.
- Returns:
- The maximum item count.
- See Also:
setMaximumItemCount(int)
public Number getX(int index)
Returns the x-value at the specified index.
- Parameters:
index
- the index (zero-based).
- Returns:
- The x-value (never
null
).
public Number getY(int index)
Returns the y-value at the specified index.
- Parameters:
index
- the index (zero-based).
- Returns:
- The y-value (possibly
null
).
public 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. Be aware that for an unsorted series, the index is found by iterating through all items in the series.
- Parameters:
x
- the x-value (null
not permitted).
- Returns:
- The index.
public XYDataItem remove(Number x)
Removes the item with the specified x-value and sends aSeriesChangeEvent
to all registered listeners.
- Parameters:
x
- the x-value.
- Returns:
- The item removed.
public XYDataItem remove(int index)
Removes the item at the specified index and sends aSeriesChangeEvent
to all registered listeners.
- Parameters:
index
- the index.
- Returns:
- The item removed.
public void setMaximumItemCount(int maximum)
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 aSeriesChangeEvent
will be sent to all registered listeners.
- Parameters:
maximum
- the maximum number of items for the series.
public double[][] toArray()
Returns a new array containing the x and y values from this series.
- Returns:
- A new array containing the x and y values from this series.
- Since:
- 1.0.4
public void update(Number x, Number y)
Updates an item in the series.
- Parameters:
x
- the x-value (null
not permitted).y
- the y-value (null
permitted).
public void update(int index, Number y)
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 aSeriesChangeEvent
to all registered listeners.
- Parameters:
index
- the item (zero based index).y
- the new value (null
permitted).
public void updateByIndex(int index, Number y)
Updates the value of an item in the series and sends aSeriesChangeEvent
to all registered listeners.
- Parameters:
index
- the item (zero based index).y
- the new value (null
permitted).
- Since:
- 1.0.1