public class ComparableObjectSeries extends Series implements java.lang.Cloneable, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected java.util.List |
data
Storage for the data items in the series.
|
Constructor and Description |
---|
ComparableObjectSeries(java.lang.Comparable key)
Creates a new empty series.
|
ComparableObjectSeries(java.lang.Comparable key,
boolean autoSort,
boolean allowDuplicateXValues)
Constructs a new series that contains no data.
|
Modifier and Type | Method and Description |
---|---|
protected void |
add(java.lang.Comparable x,
java.lang.Object y)
Adds new data to the series and sends a
SeriesChangeEvent to
all registered listeners. |
protected void |
add(java.lang.Comparable x,
java.lang.Object y,
boolean notify)
Adds new data to the series and, if requested, sends a
SeriesChangeEvent to all registered listeners. |
protected void |
add(ComparableObjectItem 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 and, unless the series is
already empty, sends a
SeriesChangeEvent to all registered
listeners. |
protected 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 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.
|
protected ComparableObjectItem |
getDataItem(int index)
Return the data item with the specified index.
|
int |
getItemCount()
Returns the number of items in the series.
|
int |
getMaximumItemCount()
Returns the maximum number of items that will be retained in the series.
|
int |
hashCode()
Returns a hash code.
|
int |
indexOf(java.lang.Comparable 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.
|
ComparableObjectItem |
remove(java.lang.Comparable x)
Removes the item with the specified x-value and sends a
SeriesChangeEvent to all registered listeners. |
protected ComparableObjectItem |
remove(int index)
Removes the item at the specified index 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.
|
protected void |
update(java.lang.Comparable x,
java.lang.Object y)
Updates an item in the series.
|
protected void |
updateByIndex(int index,
java.lang.Object y)
Updates the value of an item in the series and sends a
SeriesChangeEvent to all registered listeners. |
addChangeListener, addPropertyChangeListener, addVetoableChangeListener, clone, firePropertyChange, fireSeriesChanged, fireVetoableChange, getDescription, getKey, getNotify, isEmpty, notifyListeners, removeChangeListener, removePropertyChangeListener, removeVetoableChangeListener, setDescription, setKey, setNotify
protected java.util.List data
public ComparableObjectSeries(java.lang.Comparable key)
key
- the series key (null
not permitted).public ComparableObjectSeries(java.lang.Comparable key, boolean autoSort, boolean allowDuplicateXValues)
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 boolean getAutoSort()
public boolean getAllowDuplicateXValues()
public int getItemCount()
getItemCount
in class Series
public int getMaximumItemCount()
Integer.MAX_VALUE
.setMaximumItemCount(int)
public void setMaximumItemCount(int maximum)
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.protected void add(java.lang.Comparable x, java.lang.Object 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).protected void add(java.lang.Comparable x, java.lang.Object 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.protected void add(ComparableObjectItem 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 int indexOf(java.lang.Comparable x)
x
- the x-value (null
not permitted).protected void update(java.lang.Comparable x, java.lang.Object y)
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.protected void updateByIndex(int index, java.lang.Object y)
SeriesChangeEvent
to all registered listeners.index
- the item (zero based index).y
- the new value (null
permitted).protected ComparableObjectItem getDataItem(int index)
index
- the index.protected void delete(int start, int end)
SeriesChangeEvent
to all registered listeners.start
- the start index (zero-based).end
- the end index (zero-based).public void clear()
SeriesChangeEvent
to all registered
listeners.protected ComparableObjectItem remove(int index)
SeriesChangeEvent
to all registered listeners.index
- the index.public ComparableObjectItem remove(java.lang.Comparable x)
SeriesChangeEvent
to all registered listeners.x
- the x-value.public boolean equals(java.lang.Object obj)