Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: v_borchert@despammed.com (Volker Borchert) Newsgroups: comp.lang.java.programmer Subject: Re: idea for more efficient HashMap Date: 12 Jan 2013 14:21:05 GMT Organization: Private site at Eddersheim, Germany Lines: 22 Distribution: world Message-ID: References: <9hc2f8ltgn1bmdsrk8vb9kuu1vi5dkl2r5@4ax.com> X-Trace: individual.net XhXAzvznwdmCzcgs+Khi5w7knRQDgE/bIdibFqLr4yst45fApZBvBtCS6huWrmpqSQ Cancel-Lock: sha1:VJXXxi7SFSuLRx7AjHsL6u7pjFY= Xref: csiph.com comp.lang.java.programmer:21357 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. Use linear probing instead of chained buckets. IdentityHashMap does so. -- "I'm a doctor, not a mechanic." Dr Leonard McCoy "I'm a mechanic, not a doctor." Volker Borchert