Jez Higgins

Freelance software generalist
software created
extended or repaired


Older posts are available in the archive or through tags.

Feed

Follow me on Twitter
My code on GitHub

Contact
About

Friday 02 February 2007 accu2007: Finding the utility in a java.util.Iterator

Back in October, I pitched a session on Java iterators for this year's ACCU Conference. I've tidied up the synopsys a bit, and here's the revised version.


    for(Iterator i = c.iterator(); i.hasNext(); )
{
Thing t = (Thing)t.next();
...
}

Is rolling through a for loop the best a java.util.Iterator can hope for in life? A poster-child of poor design, is running from one end of a container to the other all that Iterators are good for?

The C++ Standard Library also has a thing, lots of things, called iterators. They are part of the glue that combines containers with algorithms. The Library wouldn't be what it is without them.

The Java library gives us any number of containers, but almost nothing in the way of algorithms. Why not? Any why isn't anyone complaining? What impact has it had on the way other libraries for Java are written?

By examining some of the ways iterators and enumerators are used in other languages, we can widen the horizons of a Java Iterator. Using libraries like Jakarta Collections, Mango, and JGA as examples, this session aims to show how Iterators can be taken beyond simple for loops to become a significant and useful part of the Java toolbox.


Best get on and write it, I suppose. I think I have the narrative arc more or less worked out, so I have the shape. It's just the doing it. Or at least the starting, I find that once I've started something I can generally crack on (as an aside, that's what I do like this (10+2)*5).

At last year's conference I was in the first slot of the first day, which I enjoyed because it meant I could do my talk and enjoy the rest of the conference, but it meant I missed a session I would rather have liked to see. I volunteered for a similar early slot this year. I've up first thing after lunch on the first day, which is fine, but there's not just one session I'd like to see, there are three. Curses! Actually, the whole timetable is full of slots where there are two, three or even four sessions I'd like to go see. It's an infuriatingly good schedule.


Tagged accu-conference, and iterators


Jez Higgins

Freelance software generalist
software created
extended or repaired

Older posts are available in the archive or through tags.

Feed

Follow me on Twitter
My code on GitHub

Contact
About