Java XML NodeList toList(NodeList nodes)

Here you can find the source of toList(NodeList nodes)

Description

to List

License

BSD License

Declaration

public static List<Node> toList(NodeList nodes) 

Method Source Code

//package com.java2s;
//License from project: BSD License 

import java.util.ArrayList;

import java.util.List;

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class Main {
    public static List<Node> toList(NodeList nodes) {
        int len = nodes.getLength();
        ArrayList<Node> list = new ArrayList<Node>(len);
        for (int i = 0; i < len; i++) {
            list.add(nodes.item(i));//w w w.ja v a 2  s. c  o m
        }
        return list;
    }
}

Related

  1. toElementArray(NodeList list)
  2. toElementIterable(NodeList nodeList)
  3. toList(final NodeList aList)
  4. toList(final NodeList nodeList)
  5. toList(final NodeList nodes)
  6. toNodeArray(NodeList list)
  7. toNodeArray(NodeList list)
  8. toStream(final NodeList nodeList)
  9. toStream(NodeList nodeList)