Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!news.albasani.net!.POSTED!not-for-mail From: Lars Enderin Newsgroups: comp.lang.java.programmer Subject: Re: idea for more efficient HashMap Date: Thu, 17 Jan 2013 10:23:19 +0100 Organization: albasani.net Lines: 36 Message-ID: <50F7C307.7060407@telia.com> References: <9hc2f8ltgn1bmdsrk8vb9kuu1vi5dkl2r5@4ax.com> <50f4ef8e$0$80160$742ec2ed@news.sonic.net> <1d8355c1-4128-4920-9430-3a253e768cab@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net VCW346EUZOMXJ92DQR/iAmYx272uIh1RxSVmBcMMHnP/wKOaa5jKKwLAvJXISygXah63AZFegSUEKp/U3jk6QQIQfsu7D95JlV4RzbxX4rnFcSw5WRXTWxjANiXjSE/J NNTP-Posting-Date: Thu, 17 Jan 2013 09:23:26 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="apUpu/Fh/ErKpfZb+pElbOiCZucH66WntJb2tWuU3B6AhwowqJdsFJ4hC5JUuJ7ijUeBnxU7N8L0MCz2coK98FD8ndZRPP5iWqLB6RfnFgQ2F9Iw21ebnlYc7Gq/EmVy"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 In-Reply-To: <1d8355c1-4128-4920-9430-3a253e768cab@googlegroups.com> Cancel-Lock: sha1:kuPY7YeGBcAwKslpa9TPs1upRtU= Xref: csiph.com comp.lang.java.programmer:21471 2013-01-16 23:31, Robert Klemme skrev: > On Tuesday, January 15, 2013 6:56:29 AM UTC+1, Kevin McMurtrie wrote: >> In article <9hc2f8ltgn1bmdsrk8vb9kuu1vi5dkl2r5@4ax.com>, >> Roedy Green wrote: >>> Inside HashMap are little glue Entry objects that point to the key and >>> value. >> >>> What if you could implement an interface on your objects so that >>> HashMap could use them directly without separate key or Entry glue?. >>> >> >>> e.g. getKey() >>> getPrev() >>> getNext() >>> setPrev() >>> setNext() >>> >> >>> One drawback would be your objects could live on only one such >>> space-efficient HashMap. >> >> I've done this when efficiency demanded it. The downside is that you >> can't implement java.util.Map or java.util.Dictionary because of the way >> put(K,V) is declared. > > Why that? I actually have done that implementation (see above) and it is consistent with the Map interface. > >> I will not see posts from Google because I must filter them as spam > > That might be a mistake - you'll might lose valuable feedback that way. > He will not see your post then... -- Lars Enderin