Java XML NodeList listOf(final NodeList nodeList)

Here you can find the source of listOf(final NodeList nodeList)

Description

list Of

License

Open Source License

Declaration

static List<Node> listOf(final NodeList nodeList) 

Method Source Code

//package com.java2s;
/*/*w  ww  .  ja v  a  2s.  c o m*/
 // This software is subject to the terms of the Eclipse Public License v1.0
 // Agreement, available at the following URL:
 // http://www.eclipse.org/legal/epl-v10.html.
 // Copyright (C) 2007-2010 Julian Hyde
 // All Rights Reserved.
 // You must accept the terms of that agreement to use this software.
 */

import java.util.AbstractList;

import java.util.List;

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

public class Main {
    static List<Node> listOf(final NodeList nodeList) {
        return new AbstractList<Node>() {
            public Node get(int index) {
                return nodeList.item(index);
            }

            public int size() {
                return nodeList.getLength();
            }
        };
    }
}

Related

  1. iterable(final NodeList list)
  2. iterable(NodeList nodeList)
  3. iterableNodes(final NodeList nodeList)
  4. iterableNodes(final NodeList nodeList)
  5. listOf(final NodeList nodeList)
  6. mapNodeList(NodeList nodeList)
  7. mergeTextContent(final NodeList nodes)
  8. mergeTextContent(NodeList nodes)
  9. parserXml(NodeList employees, Class class_type)