| Author |
How to sort a Map with Enums
|
vuthlarhi donald
Ranch Hand
Joined: Jul 31, 2006
Posts: 76
|
|
Iwant to sort the map, so that when I print the result's ...everything must be sorted with aphabetical order, with the ordinal values as well. so I can't use a TreeMap, because that will only sort the values of the enums/ordinal values...I am running out of ideas..help.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
Use a TreeMap and provide a Comparator<Titles> or perhaps even a Comparator<Enum><?>> to the constructor.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
 |
|
|
subject: How to sort a Map with Enums
|
|
|