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: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] adding an iterator() method to nodes
  • Date: Tue, 31 Oct 2006 09:19:13 -0500

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.

Thoughts?


That either requires Java 5 or violates type-safety. And it violates the "there's exactly one way to do it" principle.

--
Elliotte Rusty Harold elharo AT metalab.unc.edu
Java I/O 2nd Edition Just Published!
http://www.cafeaulait.org/books/javaio2/
http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/




Archive powered by MHonArc 2.6.24.

Top of Page