Here\'s a description of the data structure:
It operates like a regular map with get, put, and remove methods, but has a
Why exactly do you need a sort() function ?
What do you perhaps want and need is a Red-Black Tree.
http://en.wikipedia.org/wiki/Red-black_tree
These trees are automatically sorting your input by a comparator you give. They are complex, but have excellent O(n) characteristics. Couple your tree entries as key with a hash map as dictionary and you get your datastructure.
In Java it is implemented as TreeMap as instance of SortedMap.