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

Wednesday 11 April 2007 Talk: Find the Utility in a Java Iterator

Slides and speaker notes from a 90 minute session presented at ACCU Conference 2007


    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.


Tagged talk, java, code, and accu-conference


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