× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Aaron,

You really should consider using a Comparator or implement Comparable
and use a sorted implementation. If this is the natural ordering of the
data, use a sorted implementation like TreeSet (unless you will have
null keys or duplicates). Implement Comparable and override equals/hash
code appropriately so that equal objects compare equally, are equal and
have the same hash code. If this is not the natural ordering, you should
be able to keep it very simple and can just create your Comparator
implementation as an inner class where you need to sort. Then use the
Collections sort with your Comparator.

David Morris

>>> ALBartell@xxxxxxxxxxxxxx 2/17/2004 8:17:04 AM >>>
I have been racking my head on the wall with this one.  Everything in
my
mind says it should be working, but it doesn't come out with the right
order
and I seem to lose Vector elements in the process.

I am trying to sort Objects in a Vector based on the value of one of
the
fields within each Object....

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.