Im trying to sort an ArrayList into the order that the elements of the ArrayList are found in my enumeration in Java?
So for example,
I have a enum class called Directions that contain 8 possible compass directions N,NE,E,SE,S,SW,W,NW and then Up and Down giving me 10 elements in this enum. Now for what I want the Up and Down directions wont come into it but since their in the same enum I thought I'd let you know about their existance.
Elsewhere in my code I have an ArrayList created from a KeySet of a hashmap of type Directions but the ArrayList is not sorted to follow a compass so im getting an ArrayList like this
[SE,NW,S,W,NE] when in reality I want something like this: [NE,SE,S,W,NW] from that same list.