| Method from org.jfree.data.statistics.DefaultMultiValueCategoryDataset Detail: |
public void add(List values,
Comparable rowKey,
Comparable columnKey) {
if (values == null) {
throw new IllegalArgumentException("Null 'values' argument.");
}
if (rowKey == null) {
throw new IllegalArgumentException("Null 'rowKey' argument.");
}
if (columnKey == null) {
throw new IllegalArgumentException("Null 'columnKey' argument.");
}
List vlist = new ArrayList(values.size());
Iterator iterator = values.listIterator();
while (iterator.hasNext()) {
Object obj = iterator.next();
if (obj instanceof Number) {
Number n = (Number) obj;
double v = n.doubleValue();
if (!Double.isNaN(v)) {
vlist.add(n);
}
}
}
Collections.sort(vlist);
this.data.addObject(vlist, rowKey, columnKey);
if (vlist.size() > 0) {
double maxval = Double.NEGATIVE_INFINITY;
double minval = Double.POSITIVE_INFINITY;
for (int i = 0; i < vlist.size(); i++) {
Number n = (Number) vlist.get(i);
double v = n.doubleValue();
minval = Math.min(minval, v);
maxval = Math.max(maxval, v);
}
// update the cached range values...
if (this.maximumRangeValue == null) {
this.maximumRangeValue = new Double(maxval);
}
else if (maxval > this.maximumRangeValue.doubleValue()) {
this.maximumRangeValue = new Double(maxval);
}
if (this.minimumRangeValue == null) {
this.minimumRangeValue = new Double(minval);
}
else if (minval < this.minimumRangeValue.doubleValue()) {
this.minimumRangeValue = new Double(minval);
}
this.rangeBounds = new Range(this.minimumRangeValue.doubleValue(),
this.maximumRangeValue.doubleValue());
}
fireDatasetChanged();
}
Adds a list of values to the dataset (null and Double.NaN
items are automatically removed) and sends a DatasetChangeEvent
to all registered listeners. |
public Object clone() throws CloneNotSupportedException {
DefaultMultiValueCategoryDataset clone
= (DefaultMultiValueCategoryDataset) super.clone();
clone.data = (KeyedObjects2D) this.data.clone();
return clone;
}
Returns a clone of this instance. |
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof DefaultMultiValueCategoryDataset)) {
return false;
}
DefaultMultiValueCategoryDataset that
= (DefaultMultiValueCategoryDataset) obj;
return this.data.equals(that.data);
}
Tests this dataset for equality with an arbitrary object. |
public int getColumnCount() {
return this.data.getColumnCount();
}
Returns the number of columns in the table. |
public int getColumnIndex(Comparable key) {
return this.data.getColumnIndex(key);
}
Returns the column index for a given key. |
public Comparable getColumnKey(int column) {
return this.data.getColumnKey(column);
}
|
public List getColumnKeys() {
return this.data.getColumnKeys();
}
|
public Range getRangeBounds(boolean includeInterval) {
return this.rangeBounds;
}
Returns the range of the values in this dataset's range. |
public double getRangeLowerBound(boolean includeInterval) {
double result = Double.NaN;
if (this.minimumRangeValue != null) {
result = this.minimumRangeValue.doubleValue();
}
return result;
}
Returns the minimum y-value in the dataset. |
public double getRangeUpperBound(boolean includeInterval) {
double result = Double.NaN;
if (this.maximumRangeValue != null) {
result = this.maximumRangeValue.doubleValue();
}
return result;
}
Returns the maximum y-value in the dataset. |
public int getRowCount() {
return this.data.getRowCount();
}
Returns the number of rows in the table. |
public int getRowIndex(Comparable key) {
return this.data.getRowIndex(key);
}
Returns the row index for a given key. |
public Comparable getRowKey(int row) {
return this.data.getRowKey(row);
}
|
public List getRowKeys() {
return this.data.getRowKeys();
}
|
public Number getValue(Comparable row,
Comparable column) {
List l = (List) this.data.getObject(row, column);
double average = 0.0d;
int count = 0;
if (l != null && l.size() > 0) {
for (int i = 0; i < l.size(); i++) {
Number n = (Number) l.get(i);
average += n.doubleValue();
count += 1;
}
if (count > 0) {
average = average / count;
}
}
if (count == 0) {
return null;
}
return new Double(average);
}
Returns the average value for the specified item. |
public Number getValue(int row,
int column) {
List l = (List) this.data.getObject(row, column);
double average = 0.0d;
int count = 0;
if (l != null && l.size() > 0) {
for (int i = 0; i < l.size(); i++) {
Number n = (Number) l.get(i);
average += n.doubleValue();
count += 1;
}
if (count > 0) {
average = average / count;
}
}
if (count == 0) {
return null;
}
return new Double(average);
}
Returns the average value for the specified item. |
public List getValues(int row,
int column) {
List values = (List) this.data.getObject(row, column);
if (values != null) {
return Collections.unmodifiableList(values);
}
else {
return Collections.EMPTY_LIST;
}
}
Returns a list (possibly empty) of the values for the specified item.
The returned list should be unmodifiable. |
public List getValues(Comparable rowKey,
Comparable columnKey) {
return Collections.unmodifiableList((List) this.data.getObject(rowKey,
columnKey));
}
Returns a list (possibly empty) of the values for the specified item.
The returned list should be unmodifiable. |