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.voidExecutes a provided function once per NodeList element, passing the element as an argument to the function.intReturns 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
Integerobject.
-
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
ES6Iteratorobject.
-
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
ES6Iteratorobject.
-
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
ES6Iteratorobject.
-
forEach
Executes a provided function once per NodeList element, passing the element as an argument to the function.- Parameters:
function- aFunctionobject.
-
toArray
Node[] toArray()toArray.
- Returns:
- an array of
Nodeobjects.
-