GeeCON Prague 2014*
The moose likes Java in General and the fly likes Is ArrayList acting as a bottleneck? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "Is ArrayList acting as a bottleneck?" Watch "Is ArrayList acting as a bottleneck?" New topic
Author

Is ArrayList acting as a bottleneck?

Suvojyoty Saha
Greenhorn

Joined: Apr 19, 2011
Posts: 25

Hi I have a csv file which has 1977*15 cells. One of the cells is Authors which has more than 1 author hence the data is in the format ("a,b,c") where a,b,c are different authors. My task is to get the value in all the cells, sort it (based on Authors and Document Title) and then insert it into the database.

But even before sorting the values and inserting the data onto the database i am trying to check if I have the complete data in my arraylist. hence transferring the whole data onto a self created csv file.

Its here on this newly created csv file that i am not able to view the complete data and the data retrieved keeps on changing as I try to implement different logic. Is there a bottleneck on the Arraylist while storing the data? I'm using eclipse and there is no Out of Memory error which is being shown.

Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3606
    
  15
Suvojyoty Saha wrote:i am trying to check if I have the complete data in my arraylist. hence transferring the whole data onto a self created csv file.

You're going to have to explain that a bit more. Why are you writing the data to a file in order to check if your ArrayList contains all the required data ?

Suvojyoty Saha wrote:Is there a bottleneck on the Arraylist while storing the data?

Without seeing your code nobody's going to be able to tell you what your problem is.


Joanne
Suvojyoty Saha
Greenhorn

Joined: Apr 19, 2011
Posts: 25

You are right Neal. I can just print the output. Thanks a lot.

I am able to see all the data in my arraylist but when I am trying to write it onto a .csv file why is it not writing all the data?

The code is listed below:
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4397
    
    8

You don't appear to be closing the FileWriter anywhere. So it could be a matter of the FileWriter not being flushed.

Suvojyoty Saha
Greenhorn

Joined: Apr 19, 2011
Posts: 25

Thanks a lot Matthew. I think that is the problem. Thanks a lot.
 
GeeCON Prague 2014
 
subject: Is ArrayList acting as a bottleneck?