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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
DOM change listener which clears the node cache when necessary. -
Field Summary
FieldsModifier and TypeFieldDescriptionElement cache, used to avoid XPath expression evaluation as much as possible.private DomNode
This node list's root node.Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
Constructors -
Method Summary
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.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
-
Field Details
-
node_
This node list's root node. -
cachedElements_
Element cache, used to avoid XPath expression evaluation as much as possible.
-
-
Constructor Details
-
AbstractDomNodeList
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
Returns the DOM node.- Returns:
- the DOM node
-
provideElements
Returns the elements.- Returns:
- the elements
-
getNodes
Returns the nodes in this node list, caching as necessary.- Returns:
- the nodes in this node list
-
size
public int size() -
getLength
public int getLength() -
item
-
get
-