Jiffie: Java InterFace For Internet Explorer

net.sf.jiffie.xpath
Class DocumentNavigator.NodeIterator

Package class diagram package DocumentNavigator.NodeIterator
java.lang.Object
  extended by net.sf.jiffie.xpath.DocumentNavigator.NodeIterator
All Implemented Interfaces:
java.util.Iterator<IHTMLDOMNode>
Enclosing class:
DocumentNavigator

abstract class DocumentNavigator.NodeIterator
extends java.lang.Object
implements java.util.Iterator<IHTMLDOMNode>

A generic iterator over DOM nodes.

Concrete subclasses must implement the getFirstNode(net.sf.jiffie.IHTMLDOMNode) and getNextNode(net.sf.jiffie.IHTMLDOMNode) methods for a specific iteration strategy.


Constructor Summary
DocumentNavigator.NodeIterator(IHTMLDOMNode contextNode)
          Constructor.
 
Method Summary
protected abstract  IHTMLDOMNode getFirstNode(IHTMLDOMNode contextNode)
          Get the first node for iteration.
protected abstract  IHTMLDOMNode getNextNode(IHTMLDOMNode contextNode)
          Get the next node for iteration.
 boolean hasNext()
          
 IHTMLDOMNode next()
          
 void remove()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentNavigator.NodeIterator

public DocumentNavigator.NodeIterator(IHTMLDOMNode contextNode)
Constructor.

Parameters:
contextNode - The starting node.
Method Detail

hasNext

public boolean hasNext()

Specified by:
hasNext in interface java.util.Iterator<IHTMLDOMNode>

next

public IHTMLDOMNode next()

Specified by:
next in interface java.util.Iterator<IHTMLDOMNode>

remove

public void remove()

Specified by:
remove in interface java.util.Iterator<IHTMLDOMNode>

getFirstNode

protected abstract IHTMLDOMNode getFirstNode(IHTMLDOMNode contextNode)
Get the first node for iteration.

This method must derive an initial node for iteration from a context node.

Parameters:
contextNode - The starting node.
Returns:
The first node in the iteration.
See Also:
getNextNode(net.sf.jiffie.IHTMLDOMNode)

getNextNode

protected abstract IHTMLDOMNode getNextNode(IHTMLDOMNode contextNode)
Get the next node for iteration.

This method must locate a following node from the current context node.

Parameters:
contextNode - The current node in the iteration.
Returns:
The following node in the iteration, or null if there is none.
See Also:
getFirstNode(net.sf.jiffie.IHTMLDOMNode)


Copyright © 2004-2009 Packwood Software. All Rights Reserved.