First, just on general principle - Hashtables are evil. Use HashMaps instead. This applies to all the legacy collection classes. Use ArrayList and Iterator rather than Vector and Enumeration. Peter den Haan's last post
here nicely summarizes why. Thanks.
For your question, you probably will want to do something like this:
Here I assume that each List will contain Maps (such as HashMap or Hashtable) which will contain the expected key values - and that throwing ClassCastException or NullPointerException are appropriate if these assumptions are not met. Also this is set up to sort by many different keys. Each sort may not be as fast as you'd like - the problem is that you're going to be invoking the get() method a
lot of times for each search. It would probably be faster to replace the Maps with some other custom class which caches the required search criteria in an instance field, rather than having to look it up in a table each time. But then you probably need a separate field for each key/value you want to be able to search on, and a separate Comparator to use this field. This may be worthwhile to set up, but you lose the ability to sort on an arbitrary key. So it depends what your requirements are.