1 9 package org.ozoneDB.xml.util; 10 11 import java.util.Vector ; 12 13 import java.io.Serializable ; 14 15 import org.w3c.dom.Node ; 16 import org.w3c.dom.NodeList ; 17 18 public final class ModifiableNodeList implements NodeList , Serializable { 19 20 private Vector nodes = null; 21 22 public ModifiableNodeList() { 23 this.nodes = new Vector (); 24 } 25 26 27 public ModifiableNodeList(int initialCapacity) { 28 this.nodes = new Vector (initialCapacity); 29 } 30 31 32 public void addNode(Node node) { 33 this.nodes.add(node); 34 } 35 36 37 public void removeNode(int index) { 38 this.nodes.remove(index); 39 } 40 41 42 46 public Node item(int index) { 47 return ((index >= 0) && (index < this.nodes.size())) 48 ? (Node )this.nodes.elementAt(index) : null; 49 } 50 51 52 public int getLength(){ 53 return this.nodes.size(); 54 } 55 56 } 57 | Popular Tags |