org.oXML.xpath.iterator
Class SubNodeIterator

java.lang.Object
  extended byorg.oXML.xpath.iterator.SubNodeIterator
All Implemented Interfaces:
NodeIterator
Direct Known Subclasses:
AncestorIterator, AncestorOrSelfIterator, AttributeIterator, ChildIterator, DescendantNodeIterator, DescendantOrSelfNodeIterator, FollowingIterator, FollowingSiblingIterator, NamespaceIterator, ParentNodeIterator, PrecedingIterator, PrecedingSiblingIterator

public abstract class SubNodeIterator
extends java.lang.Object
implements NodeIterator

NodeIterator that shows nodes that: a) are presented by the parent NodeIterator (set at construction time) b) are accepted by the NodeFilter (set at construction time)


Field Summary
protected  NodeIterator parent
           
 
Constructor Summary
SubNodeIterator(NodeIterator parent, NodeFilter filter)
          construct a SubNodeIterator returning all types of nodes (SHOW_ALL)
SubNodeIterator(NodeIterator parent, NodeFilter filter, int whatToShow)
          construct a SubNodeIterator returning only the specified type of node
 
Method Summary
 NodeFilter getFilter()
           
protected abstract  Node getNextNode()
          overload to create a SubNodeIterator that has a different iteration pattern than the parent NodeIterator.
 int getWhatToShow()
           
 Node nextNode()
          advance the current node in this nodeset.
 int position()
          get the position of the current node within this nodeset
 void setFilter(NodeFilter filter)
           
 void setWhatToShow(int whatToShow)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parent

protected NodeIterator parent
Constructor Detail

SubNodeIterator

public SubNodeIterator(NodeIterator parent,
                       NodeFilter filter)
construct a SubNodeIterator returning all types of nodes (SHOW_ALL)


SubNodeIterator

public SubNodeIterator(NodeIterator parent,
                       NodeFilter filter,
                       int whatToShow)
construct a SubNodeIterator returning only the specified type of node

See Also:
NodeFilter
Method Detail

position

public int position()
Description copied from interface: NodeIterator
get the position of the current node within this nodeset

Specified by:
position in interface NodeIterator

setWhatToShow

public void setWhatToShow(int whatToShow)

nextNode

public final Node nextNode()
Description copied from interface: NodeIterator
advance the current node in this nodeset.

Specified by:
nextNode in interface NodeIterator
Returns:
the new current node or null.

getNextNode

protected abstract Node getNextNode()
overload to create a SubNodeIterator that has a different iteration pattern than the parent NodeIterator.


getWhatToShow

public int getWhatToShow()

getFilter

public NodeFilter getFilter()

setFilter

public void setFilter(NodeFilter filter)

toString

public java.lang.String toString()