Example usage for org.jfree.data.time TimePeriodValues getDomainDescription

List of usage examples for org.jfree.data.time TimePeriodValues getDomainDescription

Introduction

In this page you can find the example usage for org.jfree.data.time TimePeriodValues getDomainDescription.

Prototype

public String getDomainDescription() 

Source Link

Document

Returns the domain description.

Usage

From source file:org.jfree.data.time.TimePeriodValues.java

/**
 * Tests the series for equality with another object.
 *
 * @param obj  the object (<code>null</code> permitted).
 *
 * @return <code>true</code> or <code>false</code>.
 *//*w  ww  .  ja v  a 2 s. c o m*/
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }
    if (!(obj instanceof TimePeriodValues)) {
        return false;
    }
    if (!super.equals(obj)) {
        return false;
    }
    TimePeriodValues that = (TimePeriodValues) obj;
    if (!ObjectUtilities.equal(this.getDomainDescription(), that.getDomainDescription())) {
        return false;
    }
    if (!ObjectUtilities.equal(this.getRangeDescription(), that.getRangeDescription())) {
        return false;
    }
    int count = getItemCount();
    if (count != that.getItemCount()) {
        return false;
    }
    for (int i = 0; i < count; i++) {
        if (!getDataItem(i).equals(that.getDataItem(i))) {
            return false;
        }
    }
    return true;
}

From source file:org.jfree.data.time.TimePeriodValues.java

/**
 * Tests the series for equality with another object.
 *
 * @param obj  the object (<code>null</code> permitted).
 *
 * @return <code>true</code> or <code>false</code>.
 *///from   w w w.j a  v a2 s .  c  om
@Override
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }
    if (!(obj instanceof TimePeriodValues)) {
        return false;
    }
    if (!super.equals(obj)) {
        return false;
    }
    TimePeriodValues that = (TimePeriodValues) obj;
    if (!ObjectUtilities.equal(this.getDomainDescription(), that.getDomainDescription())) {
        return false;
    }
    if (!ObjectUtilities.equal(this.getRangeDescription(), that.getRangeDescription())) {
        return false;
    }
    int count = getItemCount();
    if (count != that.getItemCount()) {
        return false;
    }
    for (int i = 0; i < count; i++) {
        if (!getDataItem(i).equals(that.getDataItem(i))) {
            return false;
        }
    }
    return true;
}

From source file:net.commerce.zocalo.freechart.ChartTest.java

public void testBasicGraph() {
    BinaryClaim claim = BinaryClaim.makeClaim("chartClaim", new User("joe", null), "a claim");
    Position yes = claim.getYesPosition();

    Ask ask1 = makeNewAsk("p1", "70", 20, yes);
    Bid bid1 = makeNewBid("p2", "30", 10, yes);
    Ask ask2 = makeNewAsk("p3", "53", 20, yes);
    Trade trade1 = makeNewBookTrade("p4", "53", 10, yes);
    Bid bid2 = makeNewBid("p4", "42", 10, yes);
    Ask ask3 = makeNewAsk("p3", "65", 20, yes);
    Trade trade2 = makeNewBookTrade("p2", "65", 20, yes);
    Bid bid3 = makeNewBid("p1", "45", 10, yes);

    TimePeriodValuesCollection valueColl;
    TimePeriodValues values = new TimePeriodValues("testing");
    values.add(ask1.timeAndPrice());/*from   ww  w . j  a v a 2s.c om*/
    values.add(bid1.timeAndPrice());
    values.add(ask2.timeAndPrice());
    values.add(trade1.timeAndPrice());
    values.add(bid2.timeAndPrice());
    values.add(ask3.timeAndPrice());
    values.add(trade2.timeAndPrice());
    values.add(bid3.timeAndPrice());
    assertEquals("Time", values.getDomainDescription());
    assertEquals(ask1.getTime(), values.getTimePeriod(0).getStart());
    assertQEquals(values.getValue(3).doubleValue(), trade1.getPrice());
    assertEquals(bid3.getTime(), values.getTimePeriod(7).getEnd());
    assertQEquals(values.getValue(7).doubleValue(), bid3.getPrice());

    valueColl = new TimePeriodValuesCollection(values);
    assertTrue(valueColl.getDomainIsPointsInTime());
}