Hello,
I have also seen that the method compare () in class Collator might help but I do not see how to bind the TreeMap and Collator.
Collator implements ComparatorYou can use it in your constructor TreeMap. So this allows sorting according to rules of practice in French:
Code:
Map m = new TreeMap(Collator.getInstance(Local.IND));
And you can do this if you just want to sort by local user:
Code:
Map m = new TreeMap(Collator.getInstance());
Finally if these rules do not suit you you can define your own, using the class RuleBasedCollator.
Bookmarks