Examples of TimeSeries


Examples of org.jfree.data.time.TimeSeries

    /**
     * Test for bug report 3446965.
     */
    public void testBug3446965() {
        TimeSeries s = new TimeSeries("s");
        s.addOrUpdate(new Year(2011), 100.0);
        s.addOrUpdate(new Year(2012), 150.0);
        s.addOrUpdate(new Year(2013), 200.0);
        s.addOrUpdate(new Year(2012), 250.0)// this line triggers the defect
        assertEquals(100.0, s.getMinY(), EPSILON);
        assertEquals(250.0, s.getMaxY(), EPSILON);
    }
View Full Code Here

Examples of org.jfree.data.time.TimeSeries

    /**
     * Some checks for the getMinY() method.
     */
    public void testGetMinY() {
        TimeSeries s1 = new TimeSeries("S1");
        assertTrue(Double.isNaN(s1.getMinY()));

        s1.add(new Year(2008), 1.1);
        assertEquals(1.1, s1.getMinY(), EPSILON);

        s1.add(new Year(2009), 2.2);
        assertEquals(1.1, s1.getMinY(), EPSILON);

        s1.add(new Year(2000), 99.9);
        assertEquals(1.1, s1.getMinY(), EPSILON);

        s1.add(new Year(2002), -1.1);
        assertEquals(-1.1, s1.getMinY(), EPSILON);

        s1.add(new Year(2003), null);
        assertEquals(-1.1, s1.getMinY(), EPSILON);

        s1.addOrUpdate(new Year(2002), null);
        assertEquals(1.1, s1.getMinY(), EPSILON);
   }
View Full Code Here

Examples of org.jfree.data.time.TimeSeries

    /**
     * Some checks for the getMaxY() method.
     */
    public void testGetMaxY() {
        TimeSeries s1 = new TimeSeries("S1");
        assertTrue(Double.isNaN(s1.getMaxY()));

        s1.add(new Year(2008), 1.1);
        assertEquals(1.1, s1.getMaxY(), EPSILON);

        s1.add(new Year(2009), 2.2);
        assertEquals(2.2, s1.getMaxY(), EPSILON);

        s1.add(new Year(2000), 99.9);
        assertEquals(99.9, s1.getMaxY(), EPSILON);

        s1.add(new Year(2002), -1.1);
        assertEquals(99.9, s1.getMaxY(), EPSILON);

        s1.add(new Year(2003), null);
        assertEquals(99.9, s1.getMaxY(), EPSILON);

        s1.addOrUpdate(new Year(2000), null);
        assertEquals(2.2, s1.getMaxY(), EPSILON);
    }
View Full Code Here

Examples of org.jfree.data.time.TimeSeries

    /**
     * A test for the clear method.
     */
    public void testClear() {
        TimeSeries s1 = new TimeSeries("S1");
        s1.add(new Year(2009), 1.1);
        s1.add(new Year(2010), 2.2);

        assertEquals(2, s1.getItemCount());

        s1.clear();
        assertEquals(0, s1.getItemCount());
        assertTrue(Double.isNaN(s1.getMinY()));
        assertTrue(Double.isNaN(s1.getMaxY()));
    }
View Full Code Here

Examples of org.wkh.bateman.trade.TimeSeries

        QuoteCollection collection = new QuoteCollection();
        TreeMap<DateTime, BigDecimal> prices = new TreeMap<DateTime, BigDecimal>();
        prices.put(open, BigDecimal.ONE);
        prices.put(later, new BigDecimal(1.3));

        TimeSeries expResult = new TimeSeries(prices);
        TimeSeries result = collection.convertQuoteToTimeSeries(quotes);

        assertEquals(expResult.getPrices().get(open), result.getPrices().get(open));
        assertEquals(expResult.getPrices().get(later), result.getPrices().get(later));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.