Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.straub-nv.de!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!aioe.org!.POSTED!not-for-mail From: Roedy Green Newsgroups: comp.lang.java.programmer Subject: idea for more efficient HashMap Date: Sat, 12 Jan 2013 01:55:33 -0800 Organization: Canadian Mind Products Lines: 18 Message-ID: <9hc2f8ltgn1bmdsrk8vb9kuu1vi5dkl2r5@4ax.com> Reply-To: Roedy Green NNTP-Posting-Host: K2Qzzs3EAqXk5RLzfhxcSw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Forte Agent 6.00/32.1186 Xref: csiph.com comp.lang.java.programmer:21348 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. -- Roedy Green Canadian Mind Products http://mindprod.com Students who hire or con others to do their homework are as foolish as couch potatoes who hire others to go to the gym for them.