• Post Reply Bookmark Topic Watch Topic
  • New Topic

What is meant by "accessing pattern" with a CSV file program  RSS feed

 
Justin Robbins
Ranch Hand
Posts: 121
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a project to complete which takes the CSV files/excel spreadsheet and cycles through column by column vertically while not stepping over onto other columns. Anywho, my teacher keeps referring to this thing called "access pattern", and I feel like I don't really understand what that means here is a code snippet of what he is referring to:

String[] data;
while( (data = reader.getLine() ) != null){
//do something here
}

What exactly does all this mean/do? I feel lost at how to approach it or accurately use it in my project. Which, in the project I have to sift through line by line gathering either a column entirely of doubles, or ints, or Strings. And then feed that data back to three methods, one which calculates the average of the column, the other which calculates the median, and the last one which calculates the mode.

How would one use that "access pattern" to do that. Also a bit confused on parsing, from what I understand I can use something like parseDouble(); and pass in a String into those parens so that instead of it returns only doubles? is that right, or does parseDouble convert Strings to doubles? how would that help in an average, median method?

sorry for all the questions, just curious as to how all this works.

Thank you
 
Campbell Ritchie
Marshal
Posts: 55761
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try searching for tat pattern, though I haven't heard of it.
Try and pass a String like "123.45" to Double.parseDouble() and see what happens.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!