Example usage for org.jfree.data KeyedObjects2D getRowKeys

List of usage examples for org.jfree.data KeyedObjects2D getRowKeys

Introduction

In this page you can find the example usage for org.jfree.data KeyedObjects2D getRowKeys.

Prototype

public List getRowKeys() 

Source Link

Document

Returns the row keys.

Usage

From source file:org.jfree.data.KeyedObjects2D.java

/**
 * Tests this object for equality with an arbitrary object.
 *
 * @param obj  the object to test (<code>null</code> permitted).
 *
 * @return A boolean.//from  ww  w. j  av  a 2s .  c  o  m
 */
@Override
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }
    if (!(obj instanceof KeyedObjects2D)) {
        return false;
    }

    KeyedObjects2D that = (KeyedObjects2D) obj;
    if (!getRowKeys().equals(that.getRowKeys())) {
        return false;
    }
    if (!getColumnKeys().equals(that.getColumnKeys())) {
        return false;
    }
    int rowCount = getRowCount();
    if (rowCount != that.getRowCount()) {
        return false;
    }
    int colCount = getColumnCount();
    if (colCount != that.getColumnCount()) {
        return false;
    }
    for (int r = 0; r < rowCount; r++) {
        for (int c = 0; c < colCount; c++) {
            Object v1 = getObject(r, c);
            Object v2 = that.getObject(r, c);
            if (v1 == null) {
                if (v2 != null) {
                    return false;
                }
            } else {
                if (!v1.equals(v2)) {
                    return false;
                }
            }
        }
    }
    return true;
}