Closed dylanhitt closed 1 year ago
Maybe I don't understand the question, but the LinkedHashMap by definition preserves the insertion order, and that's simply achieved by appending the keys to the underlying doubly linked list that holds those inserted keys in that order. As far as I understand it, there is no other sorting needed.
Please clarify if I misread your question.
Cheers
Today I learned.
Apologies for my ignorance, in all my time I never knew that was a requirement for linkedhashmap. I will roll my own (thing).
No worries, I also double checked myself ;)
I was curious as to why the LinkedHashMap is not sortable with the underlying doublylinkedlist sort method?
If there is no reason particularly I would't mind implementing it. It seems relatively straightforward unless I'm missing something.
Thanks