Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 41598 invoked from network); 2 Apr 2009 05:31:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Apr 2009 05:31:45 -0000 Received: (qmail 4253 invoked by uid 500); 2 Apr 2009 05:31:45 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 4175 invoked by uid 500); 2 Apr 2009 05:31:44 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 4167 invoked by uid 99); 2 Apr 2009 05:31:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2009 05:31:44 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ayyagarikiran@gmail.com designates 209.85.142.188 as permitted sender) Received: from [209.85.142.188] (HELO ti-out-0910.google.com) (209.85.142.188) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2009 05:31:37 +0000 Received: by ti-out-0910.google.com with SMTP id w4so279733tib.5 for ; Wed, 01 Apr 2009 22:31:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=rSvyk55r2oOAJWUFFInd7LzaRohh8t9oxiY/hpPaBZs=; b=wP7/CaYlOAKzofNVqkyiiCmvmqKcvKEJ/dBkZ8JhKU0gRLoUKiy6CDFCixyThdzv7l wI8WxPbWopn/K9cvZAn1jKhcjx/NsLv1X+wApW0OWqCHinJdFpyViqN1a0oPviNOlOOK bfP0x6Mf68KKvNOwiquNBvlnK2l+QGnG1Vhcc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=xB3akrWcBMY2RtsciuiE2XR1ki70fWBZkYvK7f2dpPMbajYwjju5ir1dOlWVZ1756/ pY2G5Vu4ET1kCrY7VUr0p6eK/Mdqjn311R1cmO0FRqTlucD/WuKZXM97jiTr73fG9/qw lmeqyMYcNYlIsjHHbKYFVoKTNhdzRRXK1uq+Q= Received: by 10.110.2.2 with SMTP id 2mr12564549tib.2.1238650275863; Wed, 01 Apr 2009 22:31:15 -0700 (PDT) Received: from ?192.168.1.3? ([122.164.245.10]) by mx.google.com with ESMTPS id u8sm36852tia.10.2009.04.01.22.31.12 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 01 Apr 2009 22:31:15 -0700 (PDT) Message-ID: <49D44D06.2060104@gmail.com> Date: Thu, 02 Apr 2009 10:58:38 +0530 From: Kiran Ayyagari User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: Apache Directory Developers List Subject: Re: [ApacheDS][AvlTreeMap] insert() fails to replace old value References: <49D3B724.1050004@gmail.com> <27096663-8C70-4C4F-8461-5795F1757F9A@yahoo.com> In-Reply-To: <27096663-8C70-4C4F-8461-5795F1757F9A@yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org David Jencks wrote: > > > Why isn't it V insert(K, V)? AvlTreeMap doesn't appear to extend > anything.... I don't see how returning the supplied key is very useful > whereas returning the previous value if any is quite useful. that makes sense, cause its a map, but one issue is this map supports duplicates also, in this case the 'value' defined as V will not be of the same type as the one given during instantiation. e.x given the declaration as AvlTreeMap treeMap = new AvlTreeMap() in case duplicates are enabled the 'value' will hold a AvlTree type. This can easily lead to CCE without some extra checks. Alex, wdyt? is there any use case that requires the value, if yes, should the same semantic be applied to remove(K,V) also? thanks David Kiran Ayyagari