Package org.encog.app.quant.ninja

Examples of org.encog.app.quant.ninja.NinjaStreamWriter


import junit.framework.TestCase;

public class TestNinjaStreamWriter extends TestCase {

  public void testWrite() throws IOException {
    NinjaStreamWriter nsw = new NinjaStreamWriter();

    nsw.open("test.csv", true, CSVFormat.ENGLISH);

    nsw.beginBar(new GregorianCalendar(2010, 00, 01).getTime());
    nsw.storeColumn("close", 10);
    nsw.endBar();

    nsw.beginBar(new GregorianCalendar(2010, 00, 02).getTime());
    nsw.storeColumn("close", 11);
    nsw.endBar();

    nsw.close();

    BufferedReader tr = new BufferedReader(new FileReader("test.csv"));

    Assert.assertEquals("date,time,\"close\"", tr.readLine());
    Assert.assertEquals("20100101,0,10", tr.readLine());
View Full Code Here


import org.encog.util.csv.CSVFormat;

public class TestNinjaStreamWriter extends TestCase {

  public void testWrite() throws IOException {
    NinjaStreamWriter nsw = new NinjaStreamWriter();

    nsw.open("test.csv", true, CSVFormat.ENGLISH);

    nsw.beginBar(new GregorianCalendar(2010, 00, 01).getTime());
    nsw.storeColumn("close", 10);
    nsw.endBar();

    nsw.beginBar(new GregorianCalendar(2010, 00, 02).getTime());
    nsw.storeColumn("close", 11);
    nsw.endBar();

    nsw.close();

    BufferedReader tr = new BufferedReader(new FileReader("test.csv"));

    Assert.assertEquals("date,time,\"close\"", tr.readLine());
    Assert.assertEquals("20100101,0,10", tr.readLine());
View Full Code Here

TOP

Related Classes of org.encog.app.quant.ninja.NinjaStreamWriter

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.