Package org.loboevolution.html.node
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 TypeMethodDescriptionentries()
Returns an iterator, allowing code to go through all key/value pairs contained in the collection.void
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.keys()
Returns an iterator, allowing code to go through all the keys of the key/value pairs contained in the collection.Node[]
toArray()
toArray.values()
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
Returns the node with index index from the collection. The nodes are sorted in tree order. -
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
Executes a provided function once per NodeList element, passing the element as an argument to the function.- Parameters:
function
- aFunction
object.
-
toArray
Node[] toArray()toArray.
- Returns:
- an array of
Node
objects.
-