java - general purpose Comparator for a TreeMap<Object, T>? -


i need treemap<object, hghandle> objects neither comparable nor there common comparator<object>.

the order in tree beeing relevant tree itself, there general comparator use tree?

info: want add trivial caching mechanism of database-like library, specialized bulk import. since memory-consuming task, prefer use tree-based map on hashmap, bulkimportcache becomes more space efficient , can grow , shrink required.

in order able use treemap must able compare instances intend store in map. might have comparator knows different types of object can stored in map , delegates type-specific comparators based on type. way slice it, must provide comparison mechanism , 1 not exist non-comparable objects.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -