File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Sorting a Vector Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Sorting a Vector" Watch "Sorting a Vector" New topic
Author

Sorting a Vector

John Spindler
Greenhorn

Joined: Feb 12, 2002
Posts: 28
Hi everybody!,
I have two Vectors, one is full of Strings (customer descriptions) the other is full of Customer Numbers. The indexes on them are in sinc so If I call custNum[0] and custDesc[0] I get the customer number and description for the that customer. Here is my problem, boss wants them sorted. How can I sort one vector without having the other become offset? Also If I can only do it with one, how can I sort the String Vector Alphabetically?
Thanks for all your help,
John
John Spindler
Greenhorn

Joined: Feb 12, 2002
Posts: 28
Nevermind I got it, I made a Map (TreeMap) and added the elements from the Vector to the Key+Value maps then iterated through it .
Thanks.
 
 
subject: Sorting a Vector
 
Threads others viewed
Splitting an XML file
sort array of objects
Comparator
Geting row
Array
developer file tools