EVALUATION
It is not, generally speaking, feasible to add methods to interfaces after they've been released. We could consider adding these methods to TreeMap/TreeSet, but not to SortedMap/SortedSet. The reporter's suggested workaround for successor is fine. The suggested workaround for predecessor does not work, as collections do not, in general, support the clone operation. Further, it would be far too expensive (O(n), with a high constant factor, for what should be an O(log(n)) operation). A better workaround has been added.
joshua.bloch@Eng 2000-04-14
The submitter's suggstion will be satisfied with the new
lower/higher/floor/ceiling methods added to NavigableMap and NavigableSet,
and their implementation in Tree{Map,Set} and ConcurrentSkipList{Map,Set}
###@###.### 2005-05-10 02:46:29 GMT
|