Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #9592

Re: iteration blues

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!transit3.readnews.com!news-out.readnews.com!news-xxxfer.readnews.com!postnews.google.com!gy7g2000vbb.googlegroups.com!not-for-mail
From bob <bob@coolgroups.com>
Newsgroups comp.lang.java.programmer
Subject Re: iteration blues
Date Sat, 5 Nov 2011 12:40:51 -0700 (PDT)
Organization http://groups.google.com
Lines 47
Message-ID <b492fa49-991d-4f6c-ba58-598d20de69fe@gy7g2000vbb.googlegroups.com> (permalink)
References <a84ab4cf-a960-4783-a955-0718438dab63@bq8g2000vbb.googlegroups.com> <9hhpttFi6sU1@mid.individual.net> <9866683.514.1320428761383.JavaMail.geo-discussion-forums@yqmj32> <9hj8t5FoulU1@mid.individual.net>
NNTP-Posting-Host 184.76.139.203
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
X-Trace posting.google.com 1320522148 3813 127.0.0.1 (5 Nov 2011 19:42:28 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Sat, 5 Nov 2011 19:42:28 +0000 (UTC)
Complaints-To groups-abuse@google.com
Injection-Info gy7g2000vbb.googlegroups.com; posting-host=184.76.139.203; posting-account=v1lx5wkAAAALWYfGBkwkMb2guPF9cW2u
User-Agent G2/1.0
X-Google-Web-Client true
X-Google-Header-Order HUALESNKRC
X-HTTP-UserAgent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20100101 Firefox/7.0.1,gzip(gfe)
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9592

Show key headers only | View raw


On Nov 4, 3:55 pm, Robert Klemme <shortcut...@googlemail.com> wrote:
> On 04.11.2011 18:46, Lew wrote:
>
>
>
>
>
>
>
>
>
> > Robert Klemme wrote:
> >> I'm surprised nobody seems to mention Iterator.remove().
>
> > You must have missed:
> >>> If your algorithm is (pseudocoded):
>
> >>> for each item in collection process item delete item from
> >>> collection
>
> >>> you will need the iterator.
>
> > All right, yeah, it *did* require that one be at least minimally
> > familiar with 'java.util.Iterator' to understand exactly why "you
> > will need the iterator", but every Java programmer from beginner
> > onward surely is aware of 'Iterator#remove()', right?  Surely no one
> > calling themselves a Java programmer could be ignorant of such a
> > basic, fundamental, early concept in Java?  Could they?
>
> Well...  Judging from my experience Iterator.remove() seems to be less
> known than the other methods of that interface - although not as much as
> methods (and even the existence) of ListIterator. :-)  I would consider
> this pretty basic knowledge as you did - probably in the same area as
> the ternary operator - but empiricism often proves our assumptions
> wrong. :-)
>
> Cheers
>
>         robert
>
> --
> remember.guy do |as, often| as.you_can - without endhttp://blog.rubybestpractices.com/

Iterator.remove() is probably not well-known because it's an optional
operation.  Also, I see no easy way to tell if a given container type
supports it other than to try it.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

iteration blues bob <bob@coolgroups.com> - 2011-11-03 08:37 -0700
  Re: iteration blues Knute Johnson <nospam@knutejohnson.com> - 2011-11-03 08:51 -0700
    Re: iteration blues Lew <lewbloch@gmail.com> - 2011-11-03 09:32 -0700
      Re: iteration blues Arne Vajhøj <arne@vajhoej.dk> - 2011-11-04 21:00 -0400
        Re: iteration blues spk <jhic@speak.invalid> - 2011-11-05 07:48 -0400
  Re: iteration blues Henk van Voorthuijsen <voorth@xs4all.nl> - 2011-11-03 09:31 -0700
    Re: iteration blues Lew <lewbloch@gmail.com> - 2011-11-03 13:50 -0700
      Re: iteration blues Henk van Voorthuijsen <voorth@xs4all.nl> - 2011-11-04 08:07 -0700
    Re: iteration blues Arne Vajhøj <arne@vajhoej.dk> - 2011-11-04 21:02 -0400
  Re: iteration blues Roedy Green <see_website@mindprod.com.invalid> - 2011-11-03 10:08 -0700
  Re: iteration blues Travers Naran <tnaran@gmail.com> - 2011-11-03 22:22 -0700
  Re: iteration blues Robert Klemme <shortcutter@googlemail.com> - 2011-11-04 10:34 +0100
    Re: iteration blues Lew <lewbloch@gmail.com> - 2011-11-04 10:46 -0700
      Re: iteration blues Robert Klemme <shortcutter@googlemail.com> - 2011-11-04 23:55 +0100
        Re: iteration blues Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-04 21:06 -0400
        Re: iteration blues Lew <lewbloch@gmail.com> - 2011-11-04 20:30 -0700
        Re: iteration blues bob <bob@coolgroups.com> - 2011-11-05 12:40 -0700
          Re: iteration blues Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-05 16:14 -0400
            Re: iteration blues Lew <lewbloch@gmail.com> - 2011-11-05 13:41 -0700
    Re: iteration blues bob <bob@coolgroups.com> - 2011-11-04 13:42 -0700

csiph-web