FileDocCategorySizeDatePackage
HelperNodeList.javaAPI DocJava SE 6 API2637Tue Jun 10 00:23:04 BST 2008com.sun.org.apache.xml.internal.security.utils

HelperNodeList

public class HelperNodeList extends Object implements NodeList
author
Christian Geuer-Pollmann

Fields Summary
static Logger
log
{@link java.util.logging} logging facility
ArrayList
nodes
Field nodes
boolean
_allNodesMustHaveSameParent
Constructors Summary
public HelperNodeList()


        
     
      this(false);
   
public HelperNodeList(boolean allNodesMustHaveSameParent)

param
allNodesMustHaveSameParent

      this._allNodesMustHaveSameParent = allNodesMustHaveSameParent;
   
Methods Summary
public voidappendChild(org.w3c.dom.Node node)
Method appendChild

param
node
throws
IllegalArgumentException

      if (this._allNodesMustHaveSameParent && this.getLength() > 0) {
         if (this.item(0).getParentNode() != node.getParentNode()) {
            throw new IllegalArgumentException("Nodes have not the same Parent");
         }
      }
      nodes.add(node);
   
public intgetLength()
Method getLength

return
length of the list

      return nodes.size();
   
public org.w3c.dom.DocumentgetOwnerDocument()

return
the document that contains this nodelist

      if (this.getLength() == 0) {
         return null;
      }
      return XMLUtils.getOwnerDocument(this.item(0));
   
public org.w3c.dom.Nodeitem(int index)
Method item

param
index
return
node with inde i


      // if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "item(" + index + ") of " + this.getLength() + " nodes");

      return (Node) nodes.get(index);