1 7 package org.enhydra.xml; 8 9 import java.util.ArrayList ; 10 import java.util.List ; 11 12 import org.w3c.dom.Node ; 13 import org.w3c.dom.NodeList ; 14 15 16 17 28 public class NodeListImpl implements NodeList { 29 30 33 List nodes; 34 35 36 39 public NodeListImpl() { 40 this.nodes = new ArrayList (); 41 } 42 43 44 49 public NodeListImpl(List nodes) { 50 this.nodes = nodes; 51 } 52 53 54 59 public int getLength() { 60 return nodes.size(); 61 } 62 63 64 71 public Node item(int index) { 72 if (index < 0 || index > nodes.size()) { 73 return null; 74 } 75 return (Node ) nodes.get(index); 76 } 77 78 79 86 public NodeList append(NodeListImpl list) { 87 this.nodes.addAll(list.nodes); 88 return this; 89 } 90 91 } | Popular Tags |