| Author |
Dynamic Arrays In Java
|
Brian Mulvany
Greenhorn
Joined: Oct 19, 2004
Posts: 28
|
|
Hi I have a set of Java classes that parse a website looking for cd's. The amount of cd's vary depending on the search. I want to be able to sort the search results by price, album, artist etc. I figure one way to do this might be to use a dynamic array to store the results. I dont know how to do one of these or where to start. Has anybody here got any useful guidelines or hints as to where I can go and start. Thanks Brian
|
 |
Horatio Westock
Ranch Hand
Joined: Feb 23, 2005
Posts: 221
|
|
|
If you need dynamically sized collections of things, I recommend you read the Collections Trail. I'm sure you will find some interesting stuff there on storing and sorting collections of objects.
|
 |
Yevgeniy Treyvus
Ranch Hand
Joined: Mar 09, 2005
Posts: 48
|
|
Hey Brian, I wrote a simple example for you that should get you started. But I think once you get into it, you will see that you will probably need to make improvements in order to make it useful in your application. By the way here's the corresponding output: Sorting by column 1 ... [AbracadabraMagic Touch14.992003 , Matchbox 20Best Hits19.991999 , TitaniumsMetal Hits 10127.991967 ] Sorting by column 2 ... [Matchbox 20Best Hits19.991999 , AbracadabraMagic Touch14.992003 , TitaniumsMetal Hits 10127.991967 ] Sorting by column 3 ... [AbracadabraMagic Touch14.992003 , Matchbox 20Best Hits19.991999 , TitaniumsMetal Hits 10127.991967 ] Sorting by column 4 ... [TitaniumsMetal Hits 10127.991967 , Matchbox 20Best Hits19.991999 , AbracadabraMagic Touch14.992003 ] [ April 01, 2005: Message edited by: Yevgeniy Treyvus ]
|
SCJP, SCJD
|
 |
 |
|
|
subject: Dynamic Arrays In Java
|
|
|