Interface NodeList

All Known Implementing Classes:
DTMChildIterNodeList, DTMNodeList, DTMNodeListBase, NodeListImpl

public interface NodeList
NodeList objects are collections of nodes, usually returned by properties such as Node.childNodes and methods such as document.querySelectorAll().
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns an iterator, allowing code to go through all key/value pairs contained in the collection.
    void
    forEach(Function function)
    Executes a provided function once per NodeList element, passing the element as an argument to the function.
    int
    Returns the number of nodes in the collection.
    item(int index)
    Returns the node with index index from the collection.
    Returns an iterator, allowing code to go through all the keys of the key/value pairs contained in the collection.
    toArray.
    Returns an iterator allowing code to go through all values (nodes) of the key/value pairs contained in the collection.
  • Method Details

    • getLength

      int getLength()
      Returns the number of nodes in the collection.
      Returns:
      a Integer object.
    • item

      Node item(int index)
      Returns the node with index index from the collection. The nodes are sorted in tree order.
      Parameters:
      index - a Integer object.
      Returns:
      a Node object.
    • entries

      ES6Iterator entries()
      Returns an iterator, allowing code to go through all key/value pairs contained in the collection.
      Returns:
      a ES6Iterator object.
    • keys

      ES6Iterator keys()
      Returns an iterator, allowing code to go through all the keys of the key/value pairs contained in the collection.
      Returns:
      a ES6Iterator object.
    • values

      ES6Iterator values()
      Returns an iterator allowing code to go through all values (nodes) of the key/value pairs contained in the collection.
      Returns:
      a ES6Iterator object.
    • forEach

      void forEach(Function function)
      Executes a provided function once per NodeList element, passing the element as an argument to the function.
      Parameters:
      function - a Function object.
    • toArray

      Node[] toArray()

      toArray.

      Returns:
      an array of Node objects.