From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8eff44ec1bcf8433 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-21 09:29:28 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!freenix!wanadoo.fr!paul.duquennoy From: paul.duquennoy@wanadoo.fr (Paul Duquennoy) Newsgroups: comp.lang.ada Subject: Re: Container reqs Date: Sun, 21 Oct 2001 18:37:52 +0200 Organization: Wanadoo, l'internet avec France Telecom Message-ID: <1f1n49j.159zqh5xdtyxmN%paul.duquennoy@wanadoo.fr> References: <9qctpn$lil$1@news.huji.ac.il> <3BCC01B1.18C18C98@free.fr> <3BCC6CB7.20BAA30D@boeing.com> <3BCD2EC3.3B3C4498@free.fr> <3BCD91D9.C77668AA@free.fr> <8ghz7.32783$ev2.39537@www.newsranger.com> <3BCDB29B.EBD01D8C@free.fr> <3BCE9ACE.40B6BC3D@free.fr> <3BCF106E.254BF0D6@boeing.com> <3BCF593F.1A5FD9A@boeing.com> NNTP-Posting-Host: aste-genev-bois-104-1-1-122.abo.wanadoo.fr X-Trace: wanadoo.fr 1003681768 23329 217.128.225.122 (21 Oct 2001 16:29:28 GMT) X-Complaints-To: abuse@wanadoo.fr NNTP-Posting-Date: 21 Oct 2001 16:29:28 GMT User-Agent: MacSOUP/F-2.4.2 (unregistered) Xref: archiver1.google.com comp.lang.ada:14997 Date: 2001-10-21T16:29:28+00:00 List-Id: Simon Wright wrote: > lutz@iks-jena.de (Lutz Donnerhacke) writes: > > > * Jeffrey Carter wrote: > > >Lutz Donnerhacke wrote: > > >> >By "ordered" I mean a structure where the position of an Element within > > >> >the structure is determined by the value of the Element. What is > > >> >the next Element in the structure if the current Element has moved? > > What would the Java collections classes do under such circumstances? Assume that you have (in Java) : Collection c = new ArrayList (10); Iterator i = c.iterator(); If you do c.remove (...); and try i.next(), you get an exception. But the iterator has a remove() method that removes the last element fetched object from the collection while keeping the integrity of the iterator. If you add a new element to the collection, you will get an exception at the next call of an iterator method. So do not use any updating method of the collection itself while you are iterating over it. Use only the "remove" method of the iterator.