Toggle navigation
Home
org.neo4j.csv.reader.CharReadable to java.io.Reader
No. of Instances - 11
No. of Commits - 1
No. of Projects - {'neo4j'}
Hierarchy/Composition: SIBLING
Primitive Info: -
NameSpace: Internal -> Jdk
Mapping:
Cascading Type Change (Similar)
RawIterator<CharReadable,IOException>
to
RawIterator<Reader,IOException>
Update Anonymous class
{ private int cursor; @Override public boolean hasNext(){ return cursor < data.length; } @Override public CharReadable next(){ return Readables.wrap(new StringReader(join(data[cursor++])),"Reader" + cursor); } private String join( String[] strings){ StringBuilder builder=new StringBuilder(); for ( String string : strings) { builder.append(builder.length() > 0 ? "," : "").append(string); } if (lineEnding != null) { builder.append(lineEnding); } return builder.toString(); } @Override public void remove(){ throw new UnsupportedOperationException(); } }
to
{ private int cursor; @Override public boolean hasNext(){ return cursor < data.length; } @Override public Reader next(){ return new StringReader(join(data[cursor++])){ @Override public String toString(){ return "Reader" + cursor; } } ; } private String join( String[] strings){ StringBuilder builder=new StringBuilder(); for ( String string : strings) { builder.append(builder.length() > 0 ? "," : "").append(string); } if (lineEnding != null) { builder.append(lineEnding); } return builder.toString(); } @Override public void remove(){ throw new UnsupportedOperationException(); } }
Other
FROM_FILE.apply(file)
to
FROM_FILE.apply(file)