Example usage for org.jfree.chart.util ObjectUtils equal

List of usage examples for org.jfree.chart.util ObjectUtils equal

Introduction

In this page you can find the example usage for org.jfree.chart.util ObjectUtils equal.

Prototype

public static boolean equal(final Object o1, final Object o2) 

Source Link

Document

Returns true if the two objects are equal OR both null.

Usage

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

/**
 * Tests this dataset for equality with an arbitrary object.
 *
 * @param obj  the object (<code>null</code> permitted).
 *
 * @return A boolean.//from ww w .j av a2 s  .c  om
 */
@Override
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }
    if (obj instanceof ValueDataset) {
        ValueDataset vd = (ValueDataset) obj;
        return ObjectUtils.equal(this.value, vd.getValue());
    }
    return false;
}

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

/**
 * Tests if this object is equal to another.
 *
 * @param obj  the other object./*from   w ww  .j  a v  a2  s  .  c  o  m*/
 *
 * @return A boolean.
 */
@Override
public boolean equals(Object obj) {

    if (obj == this) {
        return true;
    }

    if (!(obj instanceof KeyedObject)) {
        return false;
    }
    KeyedObject that = (KeyedObject) obj;
    if (!ObjectUtils.equal(this.key, that.key)) {
        return false;
    }

    if (!ObjectUtils.equal(this.object, that.object)) {
        return false;
    }

    return true;
}

From source file:org.jfree.data.statistics.MeanAndStandardDeviation.java

/**
 * Tests this instance for equality with an arbitrary object.
 *
 * @param obj  the object (<code>null</code> permitted).
 *
 * @return A boolean./*from w w w .  jav a  2  s.  c o  m*/
 */
@Override
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }
    if (!(obj instanceof MeanAndStandardDeviation)) {
        return false;
    }
    MeanAndStandardDeviation that = (MeanAndStandardDeviation) obj;
    if (!ObjectUtils.equal(this.mean, that.mean)) {
        return false;
    }
    if (!ObjectUtils.equal(this.standardDeviation, that.standardDeviation)) {
        return false;
    }
    return true;
}

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

/**
 * Tests this dataset for equality with an arbitrary object.
 *
 * @param obj  the object (<code>null</code> permitted).
 *
 * @return A boolean.//w w  w.  java  2  s  .  c om
 */
@Override
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }
    if (!(obj instanceof KeyedValueDataset)) {
        return false;
    }
    KeyedValueDataset that = (KeyedValueDataset) obj;
    if (this.data == null) {
        if (that.getKey() != null || that.getValue() != null) {
            return false;
        }
        return true;
    }
    if (!ObjectUtils.equal(this.data.getKey(), that.getKey())) {
        return false;
    }
    if (!ObjectUtils.equal(this.data.getValue(), that.getValue())) {
        return false;
    }
    return true;
}

From source file:org.jfree.data.statistics.BoxAndWhiskerItem.java

/**
 * Tests this object for equality with an arbitrary object.
 *
 * @param obj  the object to test against (<code>null</code> permitted).
 *
 * @return A boolean./*from ww w  .j a v a 2 s.  c  o m*/
 */
@Override
public boolean equals(Object obj) {

    if (obj == this) {
        return true;
    }
    if (!(obj instanceof BoxAndWhiskerItem)) {
        return false;
    }
    BoxAndWhiskerItem that = (BoxAndWhiskerItem) obj;
    if (!ObjectUtils.equal(this.mean, that.mean)) {
        return false;
    }
    if (!ObjectUtils.equal(this.median, that.median)) {
        return false;
    }
    if (!ObjectUtils.equal(this.q1, that.q1)) {
        return false;
    }
    if (!ObjectUtils.equal(this.q3, that.q3)) {
        return false;
    }
    if (!ObjectUtils.equal(this.minRegularValue, that.minRegularValue)) {
        return false;
    }
    if (!ObjectUtils.equal(this.maxRegularValue, that.maxRegularValue)) {
        return false;
    }
    if (!ObjectUtils.equal(this.minOutlier, that.minOutlier)) {
        return false;
    }
    if (!ObjectUtils.equal(this.maxOutlier, that.maxOutlier)) {
        return false;
    }
    if (!ObjectUtils.equal(this.outliers, that.outliers)) {
        return false;
    }
    return true;
}

From source file:org.jfree.data.statistics.DefaultBoxAndWhiskerXYDataset.java

/**
 * Tests this dataset for equality with an arbitrary object.
 *
 * @param obj  the object (<code>null</code> permitted).
 *
 * @return A boolean.//w ww  .  j  a  v  a 2  s  .  c o m
 */
@Override
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }
    if (!(obj instanceof DefaultBoxAndWhiskerXYDataset)) {
        return false;
    }
    DefaultBoxAndWhiskerXYDataset that = (DefaultBoxAndWhiskerXYDataset) obj;
    if (!ObjectUtils.equal(this.seriesKey, that.seriesKey)) {
        return false;
    }
    if (!this.dates.equals(that.dates)) {
        return false;
    }
    if (!this.items.equals(that.items)) {
        return false;
    }
    return true;
}

From source file:org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset.java

/**
 * Tests this dataset for equality with an arbitrary object.
 *
 * @param obj  the object to test against (<code>null</code> permitted).
 *
 * @return A boolean./*  w w w .j a v  a  2 s .com*/
 */
@Override
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }
    if (obj instanceof DefaultBoxAndWhiskerCategoryDataset) {
        DefaultBoxAndWhiskerCategoryDataset dataset = (DefaultBoxAndWhiskerCategoryDataset) obj;
        return ObjectUtils.equal(this.data, dataset.data);
    }
    return false;
}