Java XML NodeList toList(final NodeList aList)

Here you can find the source of toList(final NodeList aList)

Description

to List

License

Open Source License

Declaration

@SuppressWarnings("unchecked")
    public static final <T> List<T> toList(final NodeList aList) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;

import java.util.List;

import org.w3c.dom.NodeList;

public class Main {
    @SuppressWarnings("unchecked")
    public static final <T> List<T> toList(final NodeList aList) {
        final List<T> list = new ArrayList<T>();
        for (int x = 0; x < aList.getLength(); ++x) {
            list.add((T) aList.item(x));
        }/*from w w w.j a v  a  2  s  .  c  o  m*/
        return list;
    }
}

Related

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