@Test public void testGEOParser () throws Exception { URL url = this.getClass ().getResource ("geods/geo.gds.soft.txt"); Parser p = new SuperCsvParserFactory ().parse (new UrlTsvInput (url).input ()); while(p.next ()) { } List<String> expectedRows = new ArrayList<String>(){ private static final long serialVersionUID = 1L; { add("1007_s_at"); add("1053_at"); add("117_at"); } }; assertFalse(p.next ()); assertThat(p.rowKeys (), is(expectedRows)); List<String> expectedColumns = Arrays.asList ("GSM564960\tGSM564961\tGSM564952\tGSM564958\tGSM564953\tGSM564959\tGSM564956\tGSM564957\tGSM564950\tGSM564954\tGSM564951\tGSM564955".split ("\t")); assertThat(p.columnKeys (), is(expectedColumns)); }
@Override public SuperCsvParser parse (InputStream input) throws DatasetBuilderException { return new SuperCsvParser (new CsvListReader (new InputStreamReader (input), new Builder (quoteChar, separatorChar, endOfLineSymbols).skipComments (new CommentMatcher () { @Override public boolean isComment (String line) { for (Pattern pattern : commentRegExpressions) if (pattern.matcher (line).matches ()) return true; return false; } }).build ()), rowIdParser); }
SuperCsvParserFactory extends AbstractParserFactory { @Override public SuperCsvParser parse (InputStream input) throws DatasetBuilderException { return new SuperCsvParser (new CsvListReader (new InputStreamReader (input), new Builder (quoteChar, separatorChar, endOfLineSymbols).skipComments (new CommentMatcher () { @Override public boolean isComment (String line) { for (Pattern pattern : commentRegExpressions) if (pattern.matcher (line).matches ()) return true; return false; } }).build ()), rowIdParser); } }
SuperCsvParserFactory extends AbstractParserFactory { @Override public SuperCsvParser parse (InputStream input) throws DatasetBuilderException { return new SuperCsvParser (new CsvListReader (new InputStreamReader (input), new Builder (quoteChar, separatorChar, endOfLineSymbols).skipComments (new CommentMatcher () { @Override public boolean isComment (String line) { for (Pattern pattern : commentRegExpressions) if (pattern.matcher (line).matches ()) return true; return false; } }).build ()), rowIdParser); } SuperCsvParserFactory(SuperCsvParser.RowIdParser rowIdParser); }
SuperCsvParserFactory extends AbstractParserFactory { @Override public SuperCsvParser parse (InputStream input) throws DatasetBuilderException { return new SuperCsvParser (new CsvListReader (new InputStreamReader (input), new Builder (quoteChar, separatorChar, endOfLineSymbols).skipComments (new CommentMatcher () { @Override public boolean isComment (String line) { for (Pattern pattern : commentRegExpressions) if (pattern.matcher (line).matches ()) return true; return false; } }).build ()), rowIdParser); } SuperCsvParserFactory(SuperCsvParser.RowIdParser rowIdParser); SuperCsvParserFactory quoteChar(char quoteChar); @Override void addCommentRegExpression(String regex); SuperCsvParserFactory separatorChar(int separatorChar); SuperCsvParserFactory endOfLineSymbols(String endOfLineSymbols); SuperCsvParserFactory commentRegExpressions(String... commentRegExpressions); @Override String contentType(); @Override SuperCsvParser parse(InputStream input); }
SuperCsvParserFactory extends AbstractParserFactory { @Override public SuperCsvParser parse (InputStream input) throws DatasetBuilderException { return new SuperCsvParser (new CsvListReader (new InputStreamReader (input), new Builder (quoteChar, separatorChar, endOfLineSymbols).skipComments (new CommentMatcher () { @Override public boolean isComment (String line) { for (Pattern pattern : commentRegExpressions) if (pattern.matcher (line).matches ()) return true; return false; } }).build ()), rowIdParser); } SuperCsvParserFactory(SuperCsvParser.RowIdParser rowIdParser); SuperCsvParserFactory quoteChar(char quoteChar); @Override void addCommentRegExpression(String regex); SuperCsvParserFactory separatorChar(int separatorChar); SuperCsvParserFactory endOfLineSymbols(String endOfLineSymbols); SuperCsvParserFactory commentRegExpressions(String... commentRegExpressions); @Override String contentType(); @Override SuperCsvParser parse(InputStream input);  }