I would like to insert items into a HashMap, TreeMap or SortedMap (you may suggest some other api) using a value Comparator.
I Have read many posts including this one, most of the posts suggest to re-insert the HashMap into a SortedMap with a value Comparator after all items have been inserted.
I am not interested to re-insert all values again. Isn't there an option or a Map similar data structure which supports the activation of a value Comparator after each insert?
If there is a duplicate issue i would appreciate a link (I have done some search, although I may have missed some)
Again, I am interested in adding a value to some kind of ordered Map so that all items will be ordered by the value and not the key, after each single insert.
The value in the Map entry is actually a complex Object with some getters, and I want to sort only by a specific getter on the value object.