Package org.htmlunit.html

# Class AbstractDomNodeList<E extends DomNode>

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
org.htmlunit.html.AbstractDomNodeList<E>

Type Parameters:
  `E` - The element type

All Implemented Interfaces:
  `Serializable`, `Iterable<E>`, `Collection<E>`, `List<E>`, `SequencedCollection<E>`, `DomNodeList<E>`, `NodeList`

public abstract class AbstractDomNodeList<E extends DomNode> extends AbstractList<E> implements DomNodeList<E>, Serializable
A generic DomNodeList implementation of `NodeList`.

See Also:
  - Serialized Form

- ## Field Summary

  ### Fields inherited from class java.util.AbstractList

  `modCount`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AbstractDomNodeList(DomNode node)`
  Creates a new node list.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `E`
  `get(int index)`
  `protected DomNode`
  `getDomNode()`
  Returns the DOM node.
  `int`
  `getLength()`
  `Node`
  `item(int index)`
  `protected abstract List<E>`
  `provideElements()`
  Returns the elements.
  `int`
  `size()`

  ### Methods inherited from class java.util.AbstractList

  `add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList`

  ### Methods inherited from class java.util.AbstractCollection

  `addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface java.util.Collection

  `parallelStream, removeIf, stream, toArray`

  ### Methods inherited from interface java.lang.Iterable

  `forEach`

  ### Methods inherited from interface java.util.List

  `add, add, addAll, addAll, addFirst, addLast, clear, contains, containsAll, equals, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, set, sort, spliterator, subList, toArray, toArray`

- ## Constructor Details

  - ### AbstractDomNodeList

    public AbstractDomNodeList(DomNode node)
    Creates a new node list. The elements will be "calculated" using the specified XPath expression applied on the specified node.
    Parameters:
      `node` - the node to serve as root for the XPath expression

- ## Method Details

  - ### getDomNode

    protected DomNode getDomNode()
    Returns the DOM node.
    Returns:
      the DOM node

  - ### provideElements

    protected abstract List<E> provideElements()
    Returns the elements.
    Returns:
      the elements

  - ### size

    public int size()
    Specified by:
      `size` in interface `Collection<E extends DomNode>`
    Specified by:
      `size` in interface `List<E extends DomNode>`
    Specified by:
      `size` in class `AbstractCollection<E extends DomNode>`

  - ### getLength

    public int getLength()
    Specified by:
      `getLength` in interface `NodeList`

  - ### item

    public Node item(int index)
    Specified by:
      `item` in interface `NodeList`

  - ### get

    public E get(int index)
    Specified by:
      `get` in interface `List<E extends DomNode>`
    Specified by:
      `get` in class `AbstractList<E extends DomNode>`