Example usage for org.jfree.data KeyedValues2D getRowKeys

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

Introduction

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

Prototype

public List getRowKeys();

Source Link

Document

Returns the row keys.

Usage

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

/**
 * Tests if this object is equal to another.
 *
 * @param o  the other object (<code>null</code> permitted).
 *
 * @return A boolean./*from  w  w w  . jav  a2s  .c  o  m*/
 */
public boolean equals(Object o) {

    if (o == null) {
        return false;
    }
    if (o == this) {
        return true;
    }

    if (!(o instanceof KeyedValues2D)) {
        return false;
    }
    KeyedValues2D kv2D = (KeyedValues2D) o;
    if (!getRowKeys().equals(kv2D.getRowKeys())) {
        return false;
    }
    if (!getColumnKeys().equals(kv2D.getColumnKeys())) {
        return false;
    }
    int rowCount = getRowCount();
    if (rowCount != kv2D.getRowCount()) {
        return false;
    }

    int colCount = getColumnCount();
    if (colCount != kv2D.getColumnCount()) {
        return false;
    }

    for (int r = 0; r < rowCount; r++) {
        for (int c = 0; c < colCount; c++) {
            Number v1 = getValue(r, c);
            Number v2 = kv2D.getValue(r, c);
            if (v1 == null) {
                if (v2 != null) {
                    return false;
                }
            } else {
                if (!v1.equals(v2)) {
                    return false;
                }
            }
        }
    }
    return true;
}

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

/**
 * Tests if this object is equal to another.
 *
 * @param o  the other object (<code>null</code> permitted).
 *
 * @return A boolean./*ww w.  j  a v a2  s .com*/
 */
@Override
public boolean equals(Object o) {

    if (o == null) {
        return false;
    }
    if (o == this) {
        return true;
    }

    if (!(o instanceof KeyedValues2D)) {
        return false;
    }
    KeyedValues2D kv2D = (KeyedValues2D) o;
    if (!getRowKeys().equals(kv2D.getRowKeys())) {
        return false;
    }
    if (!getColumnKeys().equals(kv2D.getColumnKeys())) {
        return false;
    }
    int rowCount = getRowCount();
    if (rowCount != kv2D.getRowCount()) {
        return false;
    }

    int colCount = getColumnCount();
    if (colCount != kv2D.getColumnCount()) {
        return false;
    }

    for (int r = 0; r < rowCount; r++) {
        for (int c = 0; c < colCount; c++) {
            Number v1 = getValue(r, c);
            Number v2 = kv2D.getValue(r, c);
            if (v1 == null) {
                if (v2 != null) {
                    return false;
                }
            } else {
                if (!v1.equals(v2)) {
                    return false;
                }
            }
        }
    }
    return true;
}