Package org.jfree.data.time.ohlc

Examples of org.jfree.data.time.ohlc.OHLCSeries


    /**
     * Simple test for the remove() method.
     */
    public void testRemove() {
        OHLCSeries s1 = new OHLCSeries("s1");
        s1.add(new Year(2006), 2.0, 4.0, 1.0, 3.0);
        s1.add(new Year(2011), 2.1, 4.1, 1.1, 3.1);
        s1.add(new Year(2010), 2.2, 4.2, 1.2, 3.2);
        assertEquals(3, s1.getItemCount());
       
        s1.remove(new Year(2010));
        assertEquals(new Year(2011), s1.getPeriod(1));
       
        s1.remove(new Year(2006));
        assertEquals(new Year(2011), s1.getPeriod(0));
    }
View Full Code Here


   
    /**
     * If you add a duplicate period, an exception should be thrown.
     */
    public void testAdditionOfDuplicatePeriod() {
        OHLCSeries s1 = new OHLCSeries("s1");
        s1.add(new Year(2006), 1.0, 1.0, 1.0, 1.0);
        boolean pass = false;
        try {
            s1.add(new Year(2006), 1.0, 1.0, 1.0, 1.0);
        }
        catch (SeriesException e) {
            pass = true;
        }
        assertTrue(pass);
View Full Code Here

TOP

Related Classes of org.jfree.data.time.ohlc.OHLCSeries

Copyright © 2018 www.massapicom. 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.