/** * Add a node to the NodeSet. Not all types of NodeSets support this * operation * * @param n Node to be added * @throws RuntimeException thrown if this NodeSet is not of * a mutable type. */ public void addNode(Node n) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); this.addElement(n); }
/** * Add a node to the NodeSet. Not all types of NodeSets support this * operation * * @param n Node to be added * @throws RuntimeException thrown if this NodeSet is not of * a mutable type. */ public void addNode(Node n) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); this.addElement(n); }
/** * Copy NodeList members into this nodelist, adding in * document order. If a node is null, don't add it. * * @param nodelist List of nodes which should now be referenced by * this NodeSet. * @throws RuntimeException thrown if this NodeSet is not of * a mutable type. */ public void addNodes(NodeList nodelist) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); if (null != nodelist) // defensive to fix a bug that Sanjiva reported. { int nChildren = nodelist.getLength(); for (int i = 0; i < nChildren; i++) { Node obj = nodelist.item(i); if (null != obj) { addElement(obj); } } } // checkDups(); }
/** * Copy NodeList members into this nodelist, adding in * document order. If a node is null, don't add it. * * @param nodelist List of nodes which should now be referenced by * this NodeSet. * @throws RuntimeException thrown if this NodeSet is not of * a mutable type. */ public void addNodes(NodeList nodelist) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); if (null != nodelist) // defensive to fix a bug that Sanjiva reported. { int nChildren = nodelist.getLength(); for (int i = 0; i < nChildren; i++) { Node obj = nodelist.item(i); if (null != obj) { addElement(obj); } } } // checkDups(); }
/** * Copy NodeList members into this nodelist, adding in * document order. Null references are not added. * * @param iterator NodeIterator which yields the nodes to be added. * @throws RuntimeException thrown if this NodeSet is not of * a mutable type. */ public void addNodes(NodeIterator iterator) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); if (null != iterator) // defensive to fix a bug that Sanjiva reported. { Node obj; while (null != (obj = iterator.nextNode())) { addElement(obj); } } // checkDups(); }
dist.addElement(currNode); else if (!stringTable.containsKey(key)) dist.addElement(currNode);
/** * Copy NodeList members into this nodelist, adding in * document order. Null references are not added. * * @param iterator NodeIterator which yields the nodes to be added. * @throws RuntimeException thrown if this NodeSet is not of * a mutable type. */ public void addNodes(NodeIterator iterator) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); if (null != iterator) // defensive to fix a bug that Sanjiva reported. { Node obj; while (null != (obj = iterator.nextNode())) { addElement(obj); } } // checkDups(); }
double d = toNumber(n); if (d == maxValue) highNodes.addElement(n);
double d = toNumber(n); if (d == minValue) lowNodes.addElement(n);
if (DOMHelper.isNodeAfter(testNode, endNode) && !DOMHelper.isNodeTheSame(testNode, endNode)) leadNodes.addElement(testNode);
if (DOMHelper.isNodeAfter(startNode, testNode) && !DOMHelper.isNodeTheSame(startNode, testNode)) trailNodes.addElement(testNode);
/** * The set:intersection function returns a node set comprising the nodes that are within * both the node sets passed as arguments to it. * * @param nl1 NodeList for first node-set. * @param nl2 NodeList for second node-set. * @return a NodeList containing the nodes in nl1 that are also * in nl2. * * @see <a href="http://www.exslt.org/">EXSLT</a> */ public static NodeList intersection(NodeList nl1, NodeList nl2) { NodeSet ns1 = new NodeSet(nl1); NodeSet ns2 = new NodeSet(nl2); NodeSet inter = new NodeSet(); inter.setShouldCacheNodes(true); for (int i = 0; i < ns1.getLength(); i++) { Node n = ns1.elementAt(i); if (ns2.contains(n)) inter.addElement(n); } return inter; }
/** * The set:difference function returns the difference between two node sets - those nodes that * are in the node set passed as the first argument that are not in the node set passed as the * second argument. * * @param nl1 NodeList for first node-set. * @param nl2 NodeList for second node-set. * @return a NodeList containing the nodes in nl1 that are not in nl2. * * @see <a href="http://www.exslt.org/">EXSLT</a> */ public static NodeList difference(NodeList nl1, NodeList nl2) { NodeSet ns1 = new NodeSet(nl1); NodeSet ns2 = new NodeSet(nl2); NodeSet diff = new NodeSet(); diff.setShouldCacheNodes(true); for (int i = 0; i < ns1.getLength(); i++) { Node n = ns1.elementAt(i); if (!ns2.contains(n)) diff.addElement(n); } return diff; }
/** * Add a node to the NodeSet. Not all types of NodeSets support this * operation * * @param n Node to be added * @throws RuntimeException thrown if this NodeSet is not of * a mutable type. */ public void addNode(Node n) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); this.addElement(n); }
/** * Add a node to the NodeSet. Not all types of NodeSets support this * operation * * @param n Node to be added * @throws RuntimeException thrown if this NodeSet is not of * a mutable type. */ public void addNode(Node n) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); this.addElement(n); }
/** * Add a node to the NodeSet. Not all types of NodeSets support this * operation * * @param n Node to be added * @throws RuntimeException thrown if this NodeSet is not of * a mutable type. */ public void addNode(Node n) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); this.addElement(n); }
/** * Add a node to the NodeSet. Not all types of NodeSets support this * operation * * @param n Node to be added * @throws RuntimeException thrown if this NodeSet is not of * a mutable type. */ public void addNode(Node n) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); this.addElement(n); }
/** * Add a node to the NodeSet. Not all types of NodeSets support this * operation * * @param n Node to be added * @throws RuntimeException thrown if this NodeSet is not of * a mutable type. */ public void addNode(Node n) { if (!m_mutable) throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!"); this.addElement(n); }