This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Sorting a Vector by a specific language? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Sorting a Vector by a specific language?" Watch "Sorting a Vector by a specific language?" New topic
Author

Sorting a Vector by a specific language?

Niklas Junel
Greenhorn

Joined: Dec 19, 2001
Posts: 11
I'm trying to sort a Vector with the static method sort() in Collections. The problem is that I want to sort it according to the Swedish language. It's possible to send an object of Collator with the sort-method (set to Locale swedish), but it doesn't seem to work. In my vector I have put objects of a class of persons (home-made class) and I want to sort it by last name, then by first name. Does my person's class need a specific method? It already have equals(),compare(Object o,Object o2) and hashCode().
------------------
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
Niklas
Please dont cross post to multple forums. Many of the visitors tot he ranch read and answer questions in more than forum and cross posting to more than one may cause them to think you're rude and not answer your question - ot they may think you'll get an answer in another forum and ignore other posts of th same question.
I am closing this thread since you already received an answer here: http://www.javaranch.com/ubb/Forum1/HTML/002443.html
------------------
Dave
Sun Certified Programmer for the Java� 2 Platform


Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sorting a Vector by a specific language?
 
Similar Threads
Sorting a Vector by a specific language?
vector sorting
JFileChooser on Mac os Language trouble
passing class name rather then object
Sorting a Vector by a specific language?