package ca.ucalgary.seahawk.util;

import java.util.Vector;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class MutableNodeList implements NodeList{
    private Vector<Node> nodes;
    public MutableNodeList(){nodes = new Vector<Node>();}
    public int getLength(){return nodes.size();}
    public Node item(int index){return nodes.elementAt(index);}
    public void add(Node n){nodes.add(n);}
    public void addAll(NodeList nl){for(int i=0; i < nl.getLength();i++){nodes.add(nl.item(i));}}
    public boolean remove(Node n){return nodes.remove(n);}
    public void clear(){nodes.clear();}
    public boolean isEmpty(){return nodes.isEmpty();}
}

