• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

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

Ranch Hand
Posts: 121
  • 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
Posts: 65114
  • 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.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!