Re: SortedList ?
On 1 Jul 2003 01:25:03 -0700, email@example.com (Meir) wrote:
>You have got to be kidding: No SortedList in Java2 ?
>I to implement a priority-queue, that accepts an Object and a priority
>integer, and inserts this "job" to the queue, with the specified
>Please note: Duplicate priorities are abviously allowed!
>I only found a SortedMap (no dups).
>I don't want to use a regular list and keep sorting it
>How is it done in Java2 ?
Use an ordinary ArrayList and insert new items in the proper location
Collections.binarySearch(list, key, comparator);
to find the proper insertion spot.
If priorities change (so that the order changes), sort the list in
Author of JSP 2.0: The Complete Reference
|All times are GMT. The time now is 11:01 AM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.