Example usage for org.jfree.data.time TimeSeries addAndOrUpdate

List of usage examples for org.jfree.data.time TimeSeries addAndOrUpdate

Introduction

In this page you can find the example usage for org.jfree.data.time TimeSeries addAndOrUpdate.

Prototype

public TimeSeries addAndOrUpdate(TimeSeries series) 

Source Link

Document

Adds or updates data from one series to another.

Usage

From source file:org.jfree.data.time.junit.TimeSeriesTest.java

/**
 * A test for the bug report 1075255.//from w  w w .  j  a  v a 2  s. c  om
 */
public void testBug1075255() {
    TimeSeries ts = new TimeSeries("dummy");
    ts.add(new FixedMillisecond(0L), 0.0);
    TimeSeries ts2 = new TimeSeries("dummy2");
    ts2.add(new FixedMillisecond(0L), 1.0);
    try {
        ts.addAndOrUpdate(ts2);
    } catch (Exception e) {
        e.printStackTrace();
        assertTrue(false);
    }
    assertEquals(1, ts.getItemCount());
}

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

/**
 * A test for the bug report 1075255./*w  w w . j  a v a2  s . co m*/
 */
@Test
public void testBug1075255() {
    TimeSeries ts = new TimeSeries("dummy");
    ts.add(new FixedMillisecond(0L), 0.0);
    TimeSeries ts2 = new TimeSeries("dummy2");
    ts2.add(new FixedMillisecond(0L), 1.0);
    try {
        ts.addAndOrUpdate(ts2);
    } catch (Exception e) {
        fail("No exceptions should be thrown.");
    }
    assertEquals(1, ts.getItemCount());
}