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:
java.io.Serializable
,java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.List<E>
,DomNodeList<E>
,org.w3c.dom.NodeList
public abstract class AbstractDomNodeList<E extends DomNode> extends java.util.AbstractList<E> implements DomNodeList<E>, java.io.Serializable
A generic DomNodeList implementation ofNodeList
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractDomNodeList(DomNode node)
Creates a new node list.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description E
get(int index)
protected DomNode
getDomNode()
Returns the DOM node.int
getLength()
org.w3c.dom.Node
item(int index)
protected abstract java.util.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
-
-
-
-
Constructor Detail
-
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 Detail
-
getDomNode
protected DomNode getDomNode()
Returns the DOM node.- Returns:
- the DOM node
-
provideElements
protected abstract java.util.List<E> provideElements()
Returns the elements.- Returns:
- the elements
-
size
public int size()
-
getLength
public int getLength()
- Specified by:
getLength
in interfaceorg.w3c.dom.NodeList
-
item
public org.w3c.dom.Node item(int index)
- Specified by:
item
in interfaceorg.w3c.dom.NodeList
-
-