xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
Re: [XOM-interest] adding an iterator() method to nodes
- From: Ed Davies <edavies AT nildram.co.uk>
- To: Steve Loughran <steve.loughran AT gmail.com>, xom-interest AT lists.ibiblio.org
- Subject: Re: [XOM-interest] adding an iterator() method to nodes
- Date: Tue, 31 Oct 2006 15:43:51 +0000
Steve Loughran wrote:
... I make my iterators implement iterable instead:
public Iterator<Node> iterator() {
return this;
}
...
Clever way to save garbage collection of a separate Iterable
object, but shouldn't an Iterable return a new Iterator each
time iterator() is called?
I realise that's not likely to happen in your common usage
pattern but, still, wouldn't it be safer to at least throw an
exception if iterator() is called twice? That wouldn't guard
against a direct cast from Iterable to Iterator, of course,
but that would be cheating.
Ed.
-
[XOM-interest] adding an iterator() method to nodes,
Steve Loughran, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Randall R Schulz, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Steve Loughran, 10/31/2006
- Re: [XOM-interest] adding an iterator() method to nodes, Randall R Schulz, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Ed Davies, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Steve Loughran, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Christian Vest Hansen, 10/31/2006
- Re: [XOM-interest] adding an iterator() method to nodes, Michael Kay, 10/31/2006
- Re: [XOM-interest] adding an iterator() method to nodes, Steve Loughran, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Christian Vest Hansen, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Steve Loughran, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Steve Loughran, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Elliotte Harold, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Steve Loughran, 10/31/2006
-
[XOM-interest] adding NamespaceContext.getNamespaces(),
Wolfgang Hoschek, 10/31/2006
-
Re: [XOM-interest] adding NamespaceContext.getNamespaces(),
Elliotte Harold, 10/31/2006
-
Re: [XOM-interest] adding NamespaceContext.getNamespaces(),
Wolfgang Hoschek, 10/31/2006
- Re: [XOM-interest] adding NamespaceContext.getNamespaces(), Elliotte Harold, 10/31/2006
-
Re: [XOM-interest] adding NamespaceContext.getNamespaces(),
Wolfgang Hoschek, 10/31/2006
-
Re: [XOM-interest] adding NamespaceContext.getNamespaces(),
Elliotte Harold, 10/31/2006
-
[XOM-interest] adding NamespaceContext.getNamespaces(),
Wolfgang Hoschek, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Steve Loughran, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Randall R Schulz, 10/31/2006
Archive powered by MHonArc 2.6.24.