xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
- From: jcowan AT reutershealth.com
- To: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
- Cc: xom-interest AT lists.ibiblio.org
- Subject: Re: [XOM-interest] XOM 1.0d23 Last Call
- Date: Mon, 2 Feb 2004 18:06:11 -0500
Elliotte Rusty Harold scripsit:
> >1) I think it's worth having a Nodes.put method to complement get. The
> >only
> > way to replace a single Node in the list currently is either to copy
> > it, which does not preserve object identity, or else to remove and
> > then insert/append, which involves copying the list anywhere up to
> > twice internally (if you want to replace the zeroth node), and requires
> > getting the insert vs. append choice correct.
>
> I'm sorry. I don't think I understand your proposal here. What would
> be the signature of this method, and what would its behavior be?
Conceptually, it looks like this:
public void put(Node node, int index) {
if (index < 0 || index >= node.size()) {
throw new IndexOutOfBoundsException("whatever");
}
else if (index == node.size()) {
remove(index);
append(node);
}
else {
remove(index);
insert(node, index);
}
Of course, you don't implement it that way, because that will involve copying
the nodes around in order to do the remove/insert pair. Instead, you
just replace the index'th entry of the internal array or whatever.
The same story applies to Element.putAttribute and element.putChild;
they conceptually remove and insert the index'th attribute or child,
but in fact just replace.
> I think alpha and beta have been seriously debased in the last
> fifteen years or so, and I'm trying to fight back. :-) To my way of
> thinking alpha 1 is feature complete. Beta 1 is free of all known
> bugs, and the release candidate has all documents and supporting
> material in place.
Okay.
--
John Cowan jcowan AT reutershealth.com
http://www.reutershealth.com http://www.ccil.org/~cowan
Humpty Dump Dublin squeaks through his norse
Humpty Dump Dublin hath a horrible vorse
But for all his kinks English / And his irismanx brogues
Humpty Dump Dublin's grandada of all rogues. --Cousin James
-
[XOM-interest] XOM 1.0d23 Last Call,
Elliotte Rusty Harold, 02/02/2004
-
Re: [XOM-interest] XOM 1.0d23 Last Call,
jcowan, 02/02/2004
- Re: [XOM-interest] XOM 1.0d23 Last Call, dirk bergstrom, 02/02/2004
-
Re: [XOM-interest] XOM 1.0d23 Last Call,
Elliotte Rusty Harold, 02/02/2004
-
Re: [XOM-interest] XOM 1.0d23 Last Call,
jcowan, 02/02/2004
-
Re: [XOM-interest] XOM 1.0d23 Last Call,
Elliotte Rusty Harold, 02/02/2004
- Re: [XOM-interest] XOM 1.0d23 Last Call, John Cowan, 02/02/2004
-
Re: [XOM-interest] XOM 1.0d23 Last Call,
Bradley S. Huffman, 02/02/2004
-
Re: [XOM-interest] XOM 1.0d23 Last Call,
John Cowan, 02/02/2004
- Re: [XOM-interest] XOM 1.0d23 Last Call, Bradley S. Huffman, 02/02/2004
-
Re: [XOM-interest] XOM 1.0d23 Last Call,
John Cowan, 02/02/2004
-
Re: [XOM-interest] XOM 1.0d23 Last Call,
Elliotte Rusty Harold, 02/02/2004
-
Re: [XOM-interest] XOM 1.0d23 Last Call,
jcowan, 02/02/2004
- Re: [XOM-interest] XOM 1.0d23 Last Call, Bill de hÓra, 02/02/2004
-
[XOM-interest] Put methods,
Elliotte Rusty Harold, 02/05/2004
- Re: [XOM-interest] Put methods, jcowan, 02/05/2004
-
[XOM-interest] hasChildren vs. getChildCount == 0,
Elliotte Rusty Harold, 02/05/2004
- Re: [XOM-interest] hasChildren vs. getChildCount == 0, Dirk Bergstrom, 02/05/2004
-
Re: [XOM-interest] XOM 1.0d23 Last Call,
jcowan, 02/02/2004
Archive powered by MHonArc 2.6.24.