1 21 package oracle.toplink.essentials.internal.ejb.cmp3.xml.parser; 23 24 import java.util.ArrayList ; 25 import org.w3c.dom.Node ; 26 import org.w3c.dom.NodeList ; 27 28 31 public class XMLNodeList implements NodeList { 32 private ArrayList nodes; 33 34 public XMLNodeList() { 35 nodes = new ArrayList (); 36 } 37 38 public XMLNodeList(int size) { 39 nodes = new ArrayList (size); 40 } 41 42 public int getLength() { 43 return nodes.size(); 44 } 45 46 public Node item(int i) { 47 return (Node )nodes.get(i); 48 } 49 50 public void add(Node node) { 51 nodes.add(node); 52 } 53 54 public void addAll(NodeList nodelist) { 55 int size = nodelist.getLength(); 56 for (int i = 0; i < size; i++) { 57 nodes.add(nodelist.item(i)); 58 } 59 } 60 } 61 | Popular Tags |