@Test public void testRead() throws IOException { Class c = TableParser.class; InputStream is = c.getResourceAsStream(testName3); List recs = TableParser.readTable(is, "3,15,54,60d,67d,73d", 50000); for (int i = 0; i < recs.size(); i++) { TableParser.Record record = (TableParser.Record) recs.get(i); for (int j = 0; j < record.values.size(); j++) { Object s = record.values.get(j); System.out.print(" " + s.toString()); } System.out.println(); } }
static public List<Record> readTable(String urlString, String format, int maxLines) throws IOException, NumberFormatException { InputStream ios; if (urlString.startsWith("http:")) { URL url = new URL(urlString); ios = url.openStream(); } else { ios = new FileInputStream(urlString); } return readTable(ios, format, maxLines); }
TableParser { static public List<Record> readTable(String urlString, String format, int maxLines) throws IOException, NumberFormatException { InputStream ios; if (urlString.startsWith("http:")) { URL url = new URL(urlString); ios = url.openStream(); } else { ios = new FileInputStream(urlString); } return readTable(ios, format, maxLines); } }
TableParser { static public List<Record> readTable(String urlString, String format, int maxLines) throws IOException, NumberFormatException { InputStream ios; if (urlString.startsWith("http:")) { URL url = new URL(urlString); ios = url.openStream(); } else { ios = new FileInputStream(urlString); } return readTable(ios, format, maxLines); } TableParser(String format); }
TableParser { static public List<Record> readTable(String urlString, String format, int maxLines) throws IOException, NumberFormatException { InputStream ios; if (urlString.startsWith("http:")) { URL url = new URL(urlString); ios = url.openStream(); } else { ios = new FileInputStream(urlString); } return readTable(ios, format, maxLines); } TableParser(String format); static List<Record> readTable(String urlString, String format, int maxLines); static List<Record> readTable(InputStream ios, String format, int maxLines); Field getField(int fldno); int getNumberOfFields(); List<Record> readAllRecords(InputStream ios, int maxLines); Record readRecord(String line); DerivedField addDerivedField(Field from, Transform transform, Class type ); }
TableParser { static public List<Record> readTable(String urlString, String format, int maxLines) throws IOException, NumberFormatException { InputStream ios; if (urlString.startsWith("http:")) { URL url = new URL(urlString); ios = url.openStream(); } else { ios = new FileInputStream(urlString); } return readTable(ios, format, maxLines); } TableParser(String format); static List<Record> readTable(String urlString, String format, int maxLines); static List<Record> readTable(InputStream ios, String format, int maxLines); Field getField(int fldno); int getNumberOfFields(); List<Record> readAllRecords(InputStream ios, int maxLines); Record readRecord(String line); DerivedField addDerivedField(Field from, Transform transform, Class type );  }