org.apache.xalan.xpath
Class MutableNodeListImpl

java.lang.Object
  |
  +--org.apache.xalan.xpath.xml.NodeVector
        |
        +--org.apache.xalan.xpath.MutableNodeListImpl

public class MutableNodeListImpl
extends NodeVector
implements MutableNodeList

**For advanced use only** Implementation of MutableNodeList.

See Also:
Serialized Form

Constructor Summary
MutableNodeListImpl()
          **For advanced use only** Create an empty nodelist.
MutableNodeListImpl(int blocksize)
          **For advanced use only** Create an empty nodelist.
MutableNodeListImpl(org.w3c.dom.Node node)
          **For advanced use only** Create a MutableNodeListImpl, and copy the members of the given nodelist into it.
MutableNodeListImpl(org.w3c.dom.NodeList nodelist)
          **For advanced use only** Create a MutableNodeListImpl, and copy the members of the given nodelist into it.
 
Method Summary
 void addNode(org.w3c.dom.Node n)
          **For advanced use only** Add a node.
 int addNodeInDocOrder(org.w3c.dom.Node node, boolean test, XPathSupport support)
          **For advanced use only** Add the node into a vector of nodes where it should occur in document order.
 int addNodeInDocOrder(org.w3c.dom.Node node, XPathSupport support)
          **For advanced use only** Add the node into a vector of nodes where it should occur in document order.
 void addNodes(org.w3c.dom.NodeList nodelist)
          **For advanced use only** Copy NodeList members into this nodelist, adding in document order.
 void addNodesInDocOrder(org.w3c.dom.NodeList nodelist, XPathSupport support)
          **For advanced use only** Copy NodeList members into this nodelist, adding in document order.
 boolean checkDups()
          **For advanced use only**  
 boolean checkDups(org.w3c.dom.Node node)
          **For advanced use only** Check for duplicates, for diagnostics.
 int getLength()
          **For advanced use only** The number of nodes in the list.
 void insertNode(org.w3c.dom.Node n, int pos)
          **For advanced use only** Insert a node at a given position.
static boolean isNodeAfter(org.w3c.dom.Node node1, org.w3c.dom.Node node2, XPathSupport support)
          **For advanced use only** Figure out if node2 should be placed after node1 when placing nodes in a list that is to be sorted in document order.
 org.w3c.dom.Node item(int index)
          **For advanced use only** Returns the indexth item in the collection.
 void removeNode(org.w3c.dom.Node n)
          **For advanced use only** Remove a node.
 void setItemNull(int pos)
          **For advanced use only** Set a item to null, so the list doesn't have to keep being compressed.
 
Methods inherited from class org.apache.xalan.xpath.xml.NodeVector
addElement, appendNodes, contains, elementAt, indexOf, indexOf, insertElementAt, removeAllElements, removeElement, removeElementAt, setElementAt, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MutableNodeListImpl

public MutableNodeListImpl()
**For advanced use only** Create an empty nodelist.

MutableNodeListImpl

public MutableNodeListImpl(int blocksize)
**For advanced use only** Create an empty nodelist.

MutableNodeListImpl

public MutableNodeListImpl(org.w3c.dom.NodeList nodelist)
**For advanced use only** Create a MutableNodeListImpl, and copy the members of the given nodelist into it.

MutableNodeListImpl

public MutableNodeListImpl(org.w3c.dom.Node node)
**For advanced use only** Create a MutableNodeListImpl, and copy the members of the given nodelist into it.
Method Detail

item

public org.w3c.dom.Node item(int index)
**For advanced use only** Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.
Parameters:
index - Index into the collection.
Returns:
The node at the indexth position in the NodeList, or null if that is not a valid index.

getLength

public int getLength()
**For advanced use only** The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive.

checkDups

public boolean checkDups(org.w3c.dom.Node node)
**For advanced use only** Check for duplicates, for diagnostics.

checkDups

public boolean checkDups()

addNode

public void addNode(org.w3c.dom.Node n)
**For advanced use only** Add a node.
Specified by:
addNode in interface MutableNodeList

insertNode

public void insertNode(org.w3c.dom.Node n,
                       int pos)
**For advanced use only** Insert a node at a given position.
Specified by:
insertNode in interface MutableNodeList

removeNode

public void removeNode(org.w3c.dom.Node n)
**For advanced use only** Remove a node.
Specified by:
removeNode in interface MutableNodeList

setItemNull

public void setItemNull(int pos)
**For advanced use only** Set a item to null, so the list doesn't have to keep being compressed.
Specified by:
setItemNull in interface MutableNodeList

addNodes

public void addNodes(org.w3c.dom.NodeList nodelist)
**For advanced use only** Copy NodeList members into this nodelist, adding in document order. If a node is null, don't add it.
Specified by:
addNodes in interface MutableNodeList

addNodesInDocOrder

public void addNodesInDocOrder(org.w3c.dom.NodeList nodelist,
                               XPathSupport support)
**For advanced use only** Copy NodeList members into this nodelist, adding in document order. If a node is null, don't add it.
Specified by:
addNodesInDocOrder in interface MutableNodeList

addNodeInDocOrder

public int addNodeInDocOrder(org.w3c.dom.Node node,
                             boolean test,
                             XPathSupport support)
**For advanced use only** Add the node into a vector of nodes where it should occur in document order.
Specified by:
addNodeInDocOrder in interface MutableNodeList
Parameters:
v - Vector of nodes, presumably containing Nodes
obj - Node object.
test - true if we should test for doc order
Returns:
insertIndex.

addNodeInDocOrder

public int addNodeInDocOrder(org.w3c.dom.Node node,
                             XPathSupport support)
**For advanced use only** Add the node into a vector of nodes where it should occur in document order.
Specified by:
addNodeInDocOrder in interface MutableNodeList
Parameters:
v - Vector of nodes, presumably containing Nodes
obj - Node object.

isNodeAfter

public static boolean isNodeAfter(org.w3c.dom.Node node1,
                                  org.w3c.dom.Node node2,
                                  XPathSupport support)
**For advanced use only** Figure out if node2 should be placed after node1 when placing nodes in a list that is to be sorted in document order. Assumes that node1 and node2 are not equal. NOTE: Make sure this does the right thing with attribute nodes!!!
Returns:
true if node2 should be placed after node1, and false if node2 should be placed before node1.