Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.chainon-marquant.org!nntpfeed.proxad.net!proxad.net!feeder2-2.proxad.net!nx01.iad01.newshosting.com!newshosting.com!69.16.185.21.MISMATCH!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: Collection to implement linked structure traverse up and down Date: Mon, 5 Dec 2011 15:08:29 -0800 (PST) Organization: http://groups.google.com Lines: 23 Message-ID: <9648596.204.1323126509665.JavaMail.geo-discussion-forums@pruu5> References: <68dffbe9-ba9e-4daa-9bab-deac913b2cfe@t38g2000prg.googlegroups.com> <4ed79fbb$0$9866$9a6e19ea@unlimited.newshosting.com> <8ed0597d-fb8b-4443-9a0f-798819cdcf5e@s4g2000yqk.googlegroups.com> Reply-To: comp.lang.java.programmer@googlegroups.com NNTP-Posting-Host: 2620:0:1000:167c:224:d7ff:fe69:5838 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1323128124 8037 127.0.0.1 (5 Dec 2011 23:35:24 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 5 Dec 2011 23:35:24 +0000 (UTC) In-Reply-To: <8ed0597d-fb8b-4443-9a0f-798819cdcf5e@s4g2000yqk.googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2620:0:1000:167c:224:d7ff:fe69:5838; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 X-Google-Web-Client: true Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:10536 ruds wrote: > Roedy Green: Can you elaborate some more on "a HashMap an ArrayList > and a TreeSet simultaneously all on the same group of objects." Consider this fragment: Map bars = new HashMap<>(); List barVals = new ArrayList<>(); Set foos = new TreeSet<>(); ... Foo foo = new Foo(); Bar bar = new Bar(); bars.put(foo, bar); barVals.add(bar); foos.add(foo); ... A pointer to the same 'foo' appears in 'bars' and in 'foos'. A pointer to the same 'bar' appears in 'bars' and in 'barVals'. Do that again with a new 'foo' and a new 'bar' a few times and you have "a group of objects" in all three collections simultaneously. -- Lew