Hi all,
Here goes the problem:
I have categories and multiple sub-categories inside each category.
Each category has a priority assigned to it. Thus the subcategories belonging to different categories should be sorted first in priority and if inside the same category they should be alphabetically sorted.
For Category priority sorting, I created a custom Comparator. I used TreeMap<String, TreeSet<String>> as data structure and passed the comparator while creating the object.
My first level priority sorting is working fine.
I have two issues:
1. The alphabetical ordering within a category is not working. This is because of issue #2.
2. When I try to do map.get(key), it always returns me null.
Is there any basic java concept that I am overlooking while coding this? Or other suggestions how this problem can be solved in a better/faster way.