@Test public void importFileTable4CSV() throws Exception { CSVIO io = new CSVIO(); VTable value = io.importVTable(new InputStreamReader(getClass().getResource("table4.csv").openStream())); assertThat(value.getColumnCount(), equalTo(13)); assertThat(value.getColumnName(0), equalTo("timestamp")); assertThat(value.getColumnName(1), equalTo("rta_MIN")); assertThat(value.getColumnName(2), equalTo("rta_MAX")); assertThat((Object) value.getColumnType(0), equalTo((Object) double.class)); assertThat((Object) value.getColumnType(1), equalTo((Object) double.class)); assertThat((Object) value.getColumnType(2), equalTo((Object) double.class)); assertThat(((ListNumber) value.getColumnData(0)).getDouble(0), equalTo(1390913220.0)); assertThat(((ListNumber) value.getColumnData(1)).getDouble(1), equalTo(0.28083333333)); assertThat(((ListNumber) value.getColumnData(2)).getDouble(2), equalTo(0.266825)); }
public VTable importVTable(Reader reader) { CsvParser parser = CsvParser.AUTOMATIC; CsvParserResult result = parser.parse(reader); if (!result.isParsingSuccessful()) { throw new RuntimeException(result.getMessage()); } if (result.getRowCount() == 0) { throw new RuntimeException("Malformed table: no lines"); } return ValueFactory.newVTable(result.getColumnTypes(), result.getColumnNames(), result.getColumnValues()); }
CSVIO { public VTable importVTable(Reader reader) { CsvParser parser = CsvParser.AUTOMATIC; CsvParserResult result = parser.parse(reader); if (!result.isParsingSuccessful()) { throw new RuntimeException(result.getMessage()); } if (result.getRowCount() == 0) { throw new RuntimeException("Malformed table: no lines"); } return ValueFactory.newVTable(result.getColumnTypes(), result.getColumnNames(), result.getColumnValues()); } }
CSVIO { public VTable importVTable(Reader reader) { CsvParser parser = CsvParser.AUTOMATIC; CsvParserResult result = parser.parse(reader); if (!result.isParsingSuccessful()) { throw new RuntimeException(result.getMessage()); } if (result.getRowCount() == 0) { throw new RuntimeException("Malformed table: no lines"); } return ValueFactory.newVTable(result.getColumnTypes(), result.getColumnNames(), result.getColumnValues()); }  }
CSVIO { public VTable importVTable(Reader reader) { CsvParser parser = CsvParser.AUTOMATIC; CsvParserResult result = parser.parse(reader); if (!result.isParsingSuccessful()) { throw new RuntimeException(result.getMessage()); } if (result.getRowCount() == 0) { throw new RuntimeException("Malformed table: no lines"); } return ValueFactory.newVTable(result.getColumnTypes(), result.getColumnNames(), result.getColumnValues()); }  void export(Object value, Writer writer); VTable importVTable(Reader reader); boolean canExport(Object data); }
CSVIO { public VTable importVTable(Reader reader) { CsvParser parser = CsvParser.AUTOMATIC; CsvParserResult result = parser.parse(reader); if (!result.isParsingSuccessful()) { throw new RuntimeException(result.getMessage()); } if (result.getRowCount() == 0) { throw new RuntimeException("Malformed table: no lines"); } return ValueFactory.newVTable(result.getColumnTypes(), result.getColumnNames(), result.getColumnValues()); }  void export(Object value, Writer writer); VTable importVTable(Reader reader); boolean canExport(Object data);  }