|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.data.Series
org.jfree.data.XYSeries
Represents a sequence of zero or more data items in the form (x, y). 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.
Field Summary | |
protected java.util.List |
data
Storage for the data items in the series. |
Constructor Summary | |
XYSeries(java.lang.String name)
Creates a new empty series. |
|
XYSeries(java.lang.String name,
boolean allowDuplicateXValues)
Deprecated. Use a XYSeries(String, boolean, boolean) instead. |
|
XYSeries(java.lang.String name,
boolean autoSort,
boolean allowDuplicateXValues)
Constructs a new xy-series that contains no data. |
Method Summary | |
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,
java.lang.Number y)
Adds a data item to the series and sends a SeriesChangeEvent to all registered
listeners. |
void |
add(double x,
java.lang.Number y,
boolean notify)
Adds a data item to the series and, if requested, sends a SeriesChangeEvent to
all registered listeners. |
void |
add(java.lang.Number x,
java.lang.Number y)
Adds new data to the series and sends a SeriesChangeEvent to all registered
listeners. |
void |
add(java.lang.Number x,
java.lang.Number y,
boolean notify)
Adds new data to the series and, if requested, sends a SeriesChangeEvent to all
registered listeners. |
void |
add(XYDataItem item)
Adds a data item to the series and 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. |
void |
clear()
Removes all data items from the series. |
java.lang.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(java.lang.Object object)
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. |
XYDataPair |
getDataPair(int index)
Deprecated. Use getDataItem(index). |
int |
getItemCount()
Returns the number of items in the series. |
java.util.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. |
java.lang.Number |
getXValue(int index)
Returns the x-value at the specified index. |
java.lang.Number |
getYValue(int index)
Returns the y-value at the specified index. |
int |
hashCode()
Returns a hash code. |
int |
indexOf(java.lang.Number x)
Returns the index of the item with the specified x-value. |
XYDataItem |
remove(int index)
Removes the item at the specified index. |
XYDataItem |
remove(java.lang.Number x)
Removes the item(s) with the specified x-value. |
void |
setMaximumItemCount(int maximum)
Sets the maximum number of items that will be retained in the series. |
void |
update(int index,
java.lang.Number y)
Updates the value of an item in the series and sends a SeriesChangeEvent to all
registered listeners. |
Methods inherited from class org.jfree.data.Series |
addChangeListener, addPropertyChangeListener, firePropertyChange, fireSeriesChanged, getDescription, getName, getNotify, notifyListeners, removeChangeListener, removePropertyChangeListener, setDescription, setName, setNotify |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.List data
Constructor Detail |
public XYSeries(java.lang.String name)
name
- the series name (null
not permitted).public XYSeries(java.lang.String name, boolean autoSort, boolean allowDuplicateXValues)
name
- the series name (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 XYSeries(java.lang.String name, boolean allowDuplicateXValues)
name
- the series name.allowDuplicateXValues
- a flag that controls whether duplicate x-values are allowed.Method Detail |
public boolean getAutoSort()
public boolean getAllowDuplicateXValues()
public int getItemCount()
public java.util.List getItems()
XYDataItem
objects and is unmodifiable).
public int getMaximumItemCount()
The default value is Integer.MAX_VALUE
).
public void setMaximumItemCount(int maximum)
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.public void add(XYDataItem item)
SeriesChangeEvent
to all registered
listeners.
item
- the (x, y) item (null
not permitted).public void add(XYDataItem item, boolean notify)
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.public void add(double x, double y)
SeriesChangeEvent
to all registered
listeners.
x
- the x value.y
- the y value.public void add(double x, double y, boolean notify)
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.public void add(double x, java.lang.Number y)
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).public void add(double x, java.lang.Number y, boolean notify)
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.public void add(java.lang.Number x, java.lang.Number y)
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).public void add(java.lang.Number x, java.lang.Number y, boolean notify)
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.public void delete(int start, int end)
SeriesChangeEvent
to all
registered listeners.
start
- the start index (zero-based).end
- the end index (zero-based).public XYDataItem remove(int index)
index
- the index.
public XYDataItem remove(java.lang.Number x)
x
- the x-value.
public void clear()
public XYDataItem getDataItem(int index)
index
- the index.
public java.lang.Number getXValue(int index)
index
- the index (zero-based).
null
).public java.lang.Number getYValue(int index)
index
- the index (zero-based).
null
).public void update(int index, java.lang.Number y)
SeriesChangeEvent
to all
registered listeners.
index
- the item (zero based index).y
- the new value (null
permitted).public int indexOf(java.lang.Number x)
x
- the x-value (null
not permitted).
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class Series
java.lang.CloneNotSupportedException
- if there is a cloning problem.public XYSeries createCopy(int start, int end) throws java.lang.CloneNotSupportedException
start
- the index of the first item to copy.end
- the index of the last item to copy.
java.lang.CloneNotSupportedException
- if there is a cloning problem.public boolean equals(java.lang.Object object)
equals
in class Series
object
- the object to test against for equality (null
permitted).
public int hashCode()
hashCode
in class Series
public XYDataPair getDataPair(int index)
index
- the index.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |