• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sorting a Vector by a specific language?

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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().
------------------
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am closing this thread since it has already been posted and answered in Java In General( intermediate ) forum.
 
reply
    Bookmark Topic Watch Topic
  • New Topic