Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XOM 1.0d23 Last Call

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • To: jcowan AT reutershealth.com
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] XOM 1.0d23 Last Call
  • Date: Mon, 2 Feb 2004 18:57:56 -0500

At 6:06 PM -0500 2/2/04, jcowan AT reutershealth.com wrote:

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);
}

OK. I think I see. It's basically a replace method, right? And it differs from insert in that it doesn't shift the position of the other nodes?

I'll need to think about this more deeply when my brain is less fuzzy than it is now. To be honest, I wasn't incredibly thrilled by adding insert and remove, but they turned out to be very useful for XInclude.
--

Elliotte Rusty Harold
elharo AT metalab.unc.edu
Effective XML (Addison-Wesley, 2003)
http://www.cafeconleche.org/books/effectivexml
http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA




Archive powered by MHonArc 2.6.24.

Top of Page