Here you can find the source of convertNodelistToSet(NodeList xpathNodeSet)
Parameter | Description |
---|---|
xpathNodeSet | a parameter |
public static Set<Node> convertNodelistToSet(NodeList xpathNodeSet)
//package com.java2s; /* NOTICE: This file has been changed by Plutext Pty Ltd for use in docx4j. * The package name has been changed; there may also be other changes. * /*from www .j a v a2s . c om*/ * This notice is included to meet the condition in clause 4(b) of the License. */ import java.util.HashSet; import java.util.Set; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { /** * Method convertNodelistToSet * * @param xpathNodeSet * @return the set with the nodelist */ public static Set<Node> convertNodelistToSet(NodeList xpathNodeSet) { if (xpathNodeSet == null) { return new HashSet<Node>(); } int length = xpathNodeSet.getLength(); Set<Node> set = new HashSet<Node>(length); for (int i = 0; i < length; i++) { set.add(xpathNodeSet.item(i)); } return set; } }