Friday, February 8, 2002 05:26 AM
I don't think you can do this, especially using a
. If you provide a custom
, you'll end up only being able to compare different
objects (the keys).
Why do you want to sort the structure by the floating point values? In this scenario, the
TreeMap doesn't make any sense; the keys are sorted (by definition) to allow fast lookups of data.
Consider using a separate structure to store your values, or have a parallel structure (perhaps a
TreeMap) which has your keys and values in reversed roles (key=