Here is an idea. I would like it if Collections. sort and Arrays.sort
would return a boolean. true means something actually changed. false
means the array was already in order.
Further there would be an additional boolean parameter to the sort to
say "items probably already in order". The sort would then do a quick
check to make sure the items were in order, and if so, bypass the full
sort.
This would be useful when you have to avoid needlessly calling
fireTableDataChanged after a sort.
It would also allow you to use sorts in an assert to ASSURE the data
are already sorted, and explode if they are not already sorted.
Since the sort is void now, all existing code would still work. You
would just have an additional method call with the optional boolean
parameter, or perhaps only in would get the boolean return.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com