objects.
| Method from org.jfree.data.xy.VectorSeriesCollection Detail: |
public void addSeries(VectorSeries series) {
if (series == null) {
throw new IllegalArgumentException("Null 'series' argument.");
}
this.data.add(series);
series.addChangeListener(this);
fireDatasetChanged();
}
Adds a series to the collection and sends a DatasetChangeEvent
to all registered listeners. |
public Object clone() throws CloneNotSupportedException {
VectorSeriesCollection clone
= (VectorSeriesCollection) super.clone();
clone.data = (List) ObjectUtilities.deepClone(this.data);
return clone;
}
Returns a clone of this instance. |
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof VectorSeriesCollection)) {
return false;
}
VectorSeriesCollection that = (VectorSeriesCollection) obj;
return ObjectUtilities.equal(this.data, that.data);
}
Tests this instance for equality with an arbitrary object. |
public int getItemCount(int series) {
// defer argument checking
return getSeries(series).getItemCount();
}
Returns the number of items in the specified series. |
public VectorSeries getSeries(int series) {
if ((series < 0) || (series >= getSeriesCount())) {
throw new IllegalArgumentException("Series index out of bounds");
}
return (VectorSeries) this.data.get(series);
}
Returns a series from the collection. |
public int getSeriesCount() {
return this.data.size();
}
Returns the number of series in the collection. |
public Comparable getSeriesKey(int series) {
// defer argument checking
return getSeries(series).getKey();
}
Returns the key for a series. |
public Vector getVector(int series,
int item) {
VectorSeries s = (VectorSeries) this.data.get(series);
VectorDataItem di = (VectorDataItem) s.getDataItem(item);
return di.getVector();
}
Returns the vector for an item in a series. |
public double getVectorXValue(int series,
int item) {
VectorSeries s = (VectorSeries) this.data.get(series);
VectorDataItem di = (VectorDataItem) s.getDataItem(item);
return di.getVectorX();
}
Returns the x-component of the vector for an item in a series. |
public double getVectorYValue(int series,
int item) {
VectorSeries s = (VectorSeries) this.data.get(series);
VectorDataItem di = (VectorDataItem) s.getDataItem(item);
return di.getVectorY();
}
Returns the y-component of the vector for an item in a series. |
public Number getX(int series,
int item) {
return new Double(getXValue(series, item));
}
Returns the x-value for an item within a series. Note that this method
creates a new Double instance every time it is called---use
#getXValue(int, int) instead, if possible. |
public double getXValue(int series,
int item) {
VectorSeries s = (VectorSeries) this.data.get(series);
VectorDataItem di = (VectorDataItem) s.getDataItem(item);
return di.getXValue();
}
Returns the x-value for an item within a series. |
public Number getY(int series,
int item) {
return new Double(getYValue(series, item));
}
Returns the y-value for an item within a series. Note that this method
creates a new Double instance every time it is called---use
#getYValue(int, int) instead, if possible. |
public double getYValue(int series,
int item) {
VectorSeries s = (VectorSeries) this.data.get(series);
VectorDataItem di = (VectorDataItem) s.getDataItem(item);
return di.getYValue();
}
Returns the y-value for an item within a series. |
public int indexOf(VectorSeries series) {
if (series == null) {
throw new IllegalArgumentException("Null 'series' argument.");
}
return this.data.indexOf(series);
}
Returns the index of the specified series, or -1 if that series is not
present in the dataset. |
public void removeAllSeries() {
// deregister the collection as a change listener to each series in the
// collection
for (int i = 0; i < this.data.size(); i++) {
VectorSeries series = (VectorSeries) this.data.get(i);
series.removeChangeListener(this);
}
// remove all the series from the collection and notify listeners.
this.data.clear();
fireDatasetChanged();
}
Removes all the series from the collection and sends a
DatasetChangeEvent to all registered listeners. |
public boolean removeSeries(VectorSeries series) {
if (series == null) {
throw new IllegalArgumentException("Null 'series' argument.");
}
boolean removed = this.data.remove(series);
if (removed) {
series.removeChangeListener(this);
fireDatasetChanged();
}
return removed;
}
Removes the specified series from the collection and sends a
DatasetChangeEvent to all registered listeners. |