where every series
shares the same x-values (required for generating stacked area charts).
This implementation uses a
Object as backend
implementation and is hence more "category oriented" than the
implementation.
This implementation provides no means to remove data items yet.
This is due to the lack of such facility in the DefaultKeyedValues2D class.
| Method from org.jfree.data.xy.CategoryTableXYDataset Detail: |
public void add(double x,
double y,
String seriesName) {
add(new Double(x), new Double(y), seriesName, true);
}
Adds a data item to this dataset and sends a DatasetChangeEvent
to all registered listeners. |
public void add(Number x,
Number y,
String seriesName,
boolean notify) {
this.values.addValue(y, (Comparable) x, seriesName);
if (notify) {
fireDatasetChanged();
}
}
Adds a data item to this dataset and, if requested, sends a
DatasetChangeEvent to all registered listeners. |
public Object clone() throws CloneNotSupportedException {
CategoryTableXYDataset clone = (CategoryTableXYDataset) super.clone();
clone.values = (DefaultKeyedValues2D) this.values.clone();
clone.intervalDelegate = new IntervalXYDelegate(clone);
// need to configure the intervalDelegate to match the original
clone.intervalDelegate.setFixedIntervalWidth(getIntervalWidth());
clone.intervalDelegate.setAutoWidth(isAutoWidth());
clone.intervalDelegate.setIntervalPositionFactor(
getIntervalPositionFactor());
return clone;
}
Returns an independent copy of this dataset. |
public boolean equals(Object obj) {
if (!(obj instanceof CategoryTableXYDataset)) {
return false;
}
CategoryTableXYDataset that = (CategoryTableXYDataset) obj;
if (!this.intervalDelegate.equals(that.intervalDelegate)) {
return false;
}
if (!this.values.equals(that.values)) {
return false;
}
return true;
}
Tests this dataset 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 full interval width. |
public int getItemCount() {
return this.values.getRowCount();
}
Returns the number of x values in the dataset. |
public int getItemCount(int series) {
return getItemCount(); // all series have the same number of items in
// this dataset
}
|
public int getSeriesCount() {
return this.values.getColumnCount();
}
Returns the number of series in the collection. |
public Comparable getSeriesKey(int series) {
return this.values.getColumnKey(series);
}
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) {
return (Number) this.values.getRowKey(item);
}
Returns the x-value for the specified series and item. |
public Number getY(int series,
int item) {
return this.values.getValue(item, series);
}
Returns the y-value for the specified series and item. |
public boolean isAutoWidth() {
return this.intervalDelegate.isAutoWidth();
}
Returns whether the interval width is automatically calculated or not. |
public void remove(double x,
String seriesName) {
remove(new Double(x), seriesName, true);
}
Removes a value from the dataset. |
public void remove(Number x,
String seriesName,
boolean notify) {
this.values.removeValue((Comparable) x, seriesName);
if (notify) {
fireDatasetChanged();
}
}
Removes an item from the dataset. |
public void setAutoWidth(boolean b) {
this.intervalDelegate.setAutoWidth(b);
fireDatasetChanged();
}
Sets the flag that indicates whether the interval width is automatically
calculated or not. |
public void setIntervalPositionFactor(double d) {
this.intervalDelegate.setIntervalPositionFactor(d);
fireDatasetChanged();
}
Sets the interval position factor. Must be between 0.0 and 1.0 inclusive.
If the factor is 0.5, the gap is in the middle of the x values. If it
is lesser than 0.5, the gap is farther to the left and if greater than
0.5 it gets farther to the right. |
public void setIntervalWidth(double d) {
this.intervalDelegate.setFixedIntervalWidth(d);
fireDatasetChanged();
}
Sets the interval width to a fixed value, and sends a
DatasetChangeEvent to all registered listeners. |