Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terrible design #50

Open
xpusostomos opened this issue Jun 22, 2021 · 0 comments
Open

Terrible design #50

xpusostomos opened this issue Jun 22, 2021 · 0 comments

Comments

@xpusostomos
Copy link

As far as I can see, this is terribly designed, because you can't get access to the column names until you've actually read the first line of real data. The column names is private in CsvIterator, which makes it impossible to get to... but even if you could get to it, it would still be awful. The CsvParser should take as arguments the things that relate to the whole file, and the CsvIterator should limit its domain to things relating to each line of data. Like this:

CsvParser p = new CsvParser(inputStreamReader, separator: ',')
for (String n in p.columns) {
println(n)
}
for (line in p.parse()) {
// process line here.
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant