Example usage for org.jfree.data.general TestIntervalCategoryDataset getValue

List of usage examples for org.jfree.data.general TestIntervalCategoryDataset getValue

Introduction

In this page you can find the example usage for org.jfree.data.general TestIntervalCategoryDataset getValue.

Prototype

@Override
public Number getValue(Comparable rowKey, Comparable columnKey) 

Source Link

Document

Returns the value for a pair of keys.

Usage

From source file:org.jfree.data.general.TestIntervalCategoryDataset.java

/**
 * Tests this dataset for equality with an arbitrary object.
 *
 * @param obj  the object (<code>null</code> permitted).
 *
 * @return A boolean./*from   w w  w  . j ava2 s  .com*/
 */
@Override
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }
    if (!(obj instanceof TestIntervalCategoryDataset)) {
        return false;
    }
    TestIntervalCategoryDataset that = (TestIntervalCategoryDataset) obj;
    if (!getRowKeys().equals(that.getRowKeys())) {
        return false;
    }
    if (!getColumnKeys().equals(that.getColumnKeys())) {
        return false;
    }
    int rowCount = getRowCount();
    int colCount = getColumnCount();
    for (int r = 0; r < rowCount; r++) {
        for (int c = 0; c < colCount; c++) {
            Number v1 = getValue(r, c);
            Number v2 = that.getValue(r, c);
            if (v1 == null) {
                if (v2 != null) {
                    return false;
                }
            } else if (!v1.equals(v2)) {
                return false;
            }
        }
    }
    return true;
}