objects that can be used as a
dataset.
| Method from org.jfree.data.xy.XYSeriesCollection Detail: |
public void addSeries(XYSeries 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 {
XYSeriesCollection clone = (XYSeriesCollection) super.clone();
clone.data = (List) ObjectUtilities.deepClone(this.data);
clone.intervalDelegate
= (IntervalXYDelegate) this.intervalDelegate.clone();
return clone;
}
Returns a clone of this instance. |
public boolean equals(Object obj) {
/*
* XXX
*
* what about the interval delegate...?
* The interval width etc wasn't considered
* before, hence i did not add it here (AS)
*
*/
if (obj == this) {
return true;
}
if (!(obj instanceof XYSeriesCollection)) {
return false;
}
XYSeriesCollection that = (XYSeriesCollection) obj;
return ObjectUtilities.equal(this.data, that.data);
}
Tests this collection for equality with an arbitrary object. |
public Range getDomainBounds(boolean includeInterval) {
if (includeInterval) {
return this.intervalDelegate.getDomainBounds(includeInterval);
}
else {
return DatasetUtilities.iterateDomainBounds(this, includeInterval);
}
}
Returns the range of the values in this dataset's domain. |
public double getDomainLowerBound(boolean includeInterval) {
return this.intervalDelegate.getDomainLowerBound(includeInterval);
}
Returns the minimum x-value in the dataset. |
public double getDomainUpperBound(boolean includeInterval) {
return this.intervalDelegate.getDomainUpperBound(includeInterval);
}
Returns the maximum x-value in the dataset. |
public Number getEndX(int series,
int item) {
return this.intervalDelegate.getEndX(series, item);
}
Returns the ending X value for the specified series and item. |
public Number getEndY(int series,
int item) {
return getY(series, item);
}
Returns the ending Y value for the specified series and item. |
public double getIntervalPositionFactor() {
return this.intervalDelegate.getIntervalPositionFactor();
}
Returns the interval position factor. |
public double getIntervalWidth() {
return this.intervalDelegate.getIntervalWidth();
}
Returns the interval width. This is used to calculate the start and end
x-values, if/when the dataset is used as an IntervalXYDataset . |
public int getItemCount(int series) {
// defer argument checking
return getSeries(series).getItemCount();
}
Returns the number of items in the specified series. |
public List getSeries() {
return Collections.unmodifiableList(this.data);
}
Returns a list of all the series in the collection. |
public XYSeries getSeries(int series) {
if ((series < 0) || (series >= getSeriesCount())) {
throw new IllegalArgumentException("Series index out of bounds");
}
return (XYSeries) this.data.get(series);
}
Returns a series from the collection. |
public XYSeries getSeries(Comparable key) {
if (key == null) {
throw new IllegalArgumentException("Null 'key' argument.");
}
Iterator iterator = this.data.iterator();
while (iterator.hasNext()) {
XYSeries series = (XYSeries) iterator.next();
if (key.equals(series.getKey())) {
return series;
}
}
throw new UnknownKeyException("Key not found: " + key);
}
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 Number getStartX(int series,
int item) {
return this.intervalDelegate.getStartX(series, item);
}
Returns the starting X value for the specified series and item. |
public Number getStartY(int series,
int item) {
return getY(series, item);
}
Returns the starting Y value for the specified series and item. |
public Number getX(int series,
int item) {
XYSeries ts = (XYSeries) this.data.get(series);
XYDataItem xyItem = ts.getDataItem(item);
return xyItem.getX();
}
Returns the x-value for the specified series and item. |
public Number getY(int series,
int index) {
XYSeries ts = (XYSeries) this.data.get(series);
XYDataItem xyItem = ts.getDataItem(index);
return xyItem.getY();
}
Returns the y-value for the specified series and item. |
public int hashCode() {
// Same question as for equals (AS)
return (this.data != null ? this.data.hashCode() : 0);
}
|
public int indexOf(XYSeries 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 boolean isAutoWidth() {
return this.intervalDelegate.isAutoWidth();
}
Returns whether the interval width is automatically calculated or not. |
public void removeAllSeries() {
// Unregister the collection as a change listener to each series in
// the collection.
for (int i = 0; i < this.data.size(); i++) {
XYSeries series = (XYSeries) 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 void removeSeries(int series) {
if ((series < 0) || (series >= getSeriesCount())) {
throw new IllegalArgumentException("Series index out of bounds.");
}
// fetch the series, remove the change listener, then remove the series.
XYSeries ts = (XYSeries) this.data.get(series);
ts.removeChangeListener(this);
this.data.remove(series);
fireDatasetChanged();
}
Removes a series from the collection and sends a
DatasetChangeEvent to all registered listeners. |
public void removeSeries(XYSeries series) {
if (series == null) {
throw new IllegalArgumentException("Null 'series' argument.");
}
if (this.data.contains(series)) {
series.removeChangeListener(this);
this.data.remove(series);
fireDatasetChanged();
}
}
Removes a series from the collection and sends a
DatasetChangeEvent to all registered listeners. |
public void setAutoWidth(boolean b) {
this.intervalDelegate.setAutoWidth(b);
fireDatasetChanged();
}
Sets the flag that indicates wether the interval width is automatically
calculated or not. |
public void setIntervalPositionFactor(double factor) {
this.intervalDelegate.setIntervalPositionFactor(factor);
fireDatasetChanged();
}
Sets the interval position factor. This controls where the x-value is in
relation to the interval surrounding the x-value (0.0 means the x-value
will be positioned at the start, 0.5 in the middle, and 1.0 at the end). |
public void setIntervalWidth(double width) {
if (width < 0.0) {
throw new IllegalArgumentException("Negative 'width' argument.");
}
this.intervalDelegate.setFixedIntervalWidth(width);
fireDatasetChanged();
}
|