Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] adding an iterator() method to nodes

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Randall R Schulz <rschulz AT sonic.net>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] adding an iterator() method to nodes
  • Date: Tue, 31 Oct 2006 06:17:08 -0800

Steve,

On Tuesday 31 October 2006 05:57, Steve Loughran wrote:
> Given that Nodes is implemented by a List internally, the cost of
> adding a method to access it is pretty low:
>
> public iterator() { return nodes.iterator();}
>
> This would make it trivial to bridge over into java 5 iterators,
> instead of trying to re-implement a list iterator, which is the sole
> option today.

Don't forget to add the "implements Iterable" clause to enable the
concise iteration syntax.

By "the sole option" do mean that XOM requires Java 5?


> Thoughts?

I agree. I'm a believer in rich APIs for generic, low-level libraries
such as that characterized by XOM. (That's just a statement of personal
design philosophy and not meant as an incitement to debate.)


> -steve


Randall Schulz




Archive powered by MHonArc 2.6.24.

Top of Page