Java XML NodeList asList(final NodeList scripts)

Here you can find the source of asList(final NodeList scripts)

Description

as List

License

Open Source License

Declaration

public static List<Node> asList(final NodeList scripts) 

Method Source Code

//package com.java2s;

import java.util.AbstractList;

import java.util.List;

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

public class Main {
    public static List<Node> asList(final NodeList scripts) {
        return new AbstractList<Node>() {
            @Override/* w ww. j  a  va2s.c o m*/
            public Node get(int index) {
                return scripts.item(index);
            }

            @Override
            public int size() {
                return scripts.getLength();
            }
        };
    }
}

Related

  1. addAll(final Node dst, final NodeList src)
  2. asList(NodeList nodeList)
  3. canonizeNodeList(NodeList nodelist)
  4. combine(final NodeList... nls)
  5. combineNodeLists(NodeList successfulReportList, NodeList failedAssertList)