Return-Path: Delivered-To: apmail-jakarta-avalon-dev-archive@apache.org Received: (qmail 32949 invoked from network); 7 Nov 2001 14:59:34 -0000 Received: from unknown (HELO osaka.betaversion.org) (192.18.49.133) by daedalus.apache.org with SMTP; 7 Nov 2001 14:59:34 -0000 Received: (qmail 10903 invoked from network); 7 Nov 2001 15:01:57 -0000 Received: from nagoya.betaversion.org (192.18.49.131) by osaka.betaversion.org with SMTP; 7 Nov 2001 15:01:57 -0000 Received: (qmail 546 invoked by uid 97); 7 Nov 2001 14:59:28 -0000 Delivered-To: qmlist-jakarta-archive-avalon-dev@jakarta.apache.org Received: (qmail 525 invoked by uid 97); 7 Nov 2001 14:59:28 -0000 Mailing-List: contact avalon-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon Developers List" Reply-To: "Avalon Developers List" Delivered-To: mailing list avalon-dev@jakarta.apache.org Received: (qmail 514 invoked from network); 7 Nov 2001 14:59:25 -0000 Message-ID: <002001c1679c$ed968bb0$0202a8c0@dell8100> From: "Chad Stansbury" To: "Avalon Developers List" References: <20010930092229.LRSP13193.mss.rdc2.nsw.optushome.com.au@there> <200111070830.fA78UJJ24305@mail008.syd.optusnet.com.au> <001101c16795$1e8c1710$0202a8c0@dell8100> <200111071452.fA7Eqd225721@mail016.syd.optusnet.com.au> Subject: Re: [Excalibur] PriorityQueue & BinaryHeap proposal Date: Wed, 7 Nov 2001 07:59:59 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Ah, that's good to see. I omitted the 'break backwards-compatibility' option because I simply don't know who this might impact. Like you mention, by having the PriorityQueue interface constrain the contents of the queue to Comparables, it's limiting the implementation possibilities. Anyhoo, I will go ahead and implement #2 for backwards compatibility purposes, and also implement a non-backwards compatible version that accepts and returns Objects. I will then hand these off to you and let you deal with it. Thanks, Chad ----- Original Message ----- From: "Peter Donald" To: "Avalon Developers List" Sent: Wednesday, November 07, 2001 7:49 AM Subject: Re: [Excalibur] PriorityQueue & BinaryHeap proposal > On Thu, 8 Nov 2001 01:04, Chad Stansbury wrote: > > Okay - here's the problem. The current BinaryHeap interface expects a > > Comparable for it's public interface. In order to maintain backwards > > compatibility I must either: > > > > 1. Add new public methods to the BinaryHeap class (e.g., insertObject, > > peekObject, popObject) and change the insert, peek, and pop methods to > > invoke these new methods, or > > 2. I can create a new BinaryObjectHeap class and have the BinaryHeap class > > act as a wrapper class. > > > > I am also wondering how I would modify the PriorityQueue interface w/o > > breaking backwards compatibility... > > > > Any suggestions would be appreciated. > > I am not sure we need to maintain 100% backwards compatability in this case. > peek() and pop() methods in al cases that I use them and have seen them used > will actually need to be cast to something else anyways. Retrieving a > Comparable from heap is rarely the aim and come to think of it I think it was > probably a mistake to return Comparables rather than Objects ;) > > For insert there will need to be backwards compatability because people will > use that to pass in comparables. However you should be ab;le to get backwards > compatability with this by just checking the type passed in (if Comparable do > X, else do Y) and converting parameter to Object. > > -- > Cheers, > > Pete > > -------------------------------------------------------------- > "Science is like sex: sometimes something useful comes out, > but that is not the reason we are doing it" -- Richard Feynman > -------------------------------------------------------------- > > -- > To unsubscribe, e-mail: > For additional commands, e-mail: > -- To unsubscribe, e-mail: For additional commands, e-mail: