I want to develop one sorting demo for car list. i am using data table to display car list (JSF datatable). Now actually i want to sort the list by car color. here it is not sort by alphabetic order. I want to use my custom order list like Red car come first, then Blue, etc.
For that i try to use Java Comparator and comparable but its allow to sort in alphabetic order only.
So, can any one guide me the way to implement and technique to use that wise the sorting became faster.
Thank you for your time,
This is a question for a JAVA forum, it is nothing with JBoss or JEE, nevertheless here the answer
// Now here I am confuse how to implement my custom sort
within the comparator compare you must check the order of colors, ATM you sort alphabetic by color