Package org.htmlunit.html
Class DomNode.DescendantElementsIterator<T extends DomNode>
java.lang.Object
org.htmlunit.html.DomNode.DescendantElementsIterator<T>
- Type Parameters:
T
- the type of nodes over which to iterate
- All Implemented Interfaces:
Iterator<T>
- Enclosing class:
DomNode
protected class DomNode.DescendantElementsIterator<T extends DomNode>
extends Object
implements Iterator<T>
Iterates over all descendants of a specific type, in document order.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDescendantElementsIterator
(Class<T> type) Creates a new instance which iterates over the specified node type. -
Method Summary
Modifier and TypeMethodDescriptionprivate DomNode
getFirstChildElement
(DomNode parent) private DomNode
getNextDomSibling
(DomNode element) private DomNode
getNextElementUpwards
(DomNode startingNode) boolean
hasNext()
protected boolean
isAccepted
(DomNode node) Indicates if the node is accepted.next()
nextNode()
void
remove()
private void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
currentNode_
-
nextNode_
-
type_
-
-
Constructor Details
-
DescendantElementsIterator
Creates a new instance which iterates over the specified node type.- Parameters:
type
- the type of nodes over which to iterate
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove() -
nextNode
- Returns:
- the next node, if there is one
-
setNextElement
private void setNextElement() -
getNextElementUpwards
-
getFirstChildElement
-
isAccepted
Indicates if the node is accepted. If not it won't be explored at all.- Parameters:
node
- the node to test- Returns:
true
if accepted
-
getNextDomSibling
-