old/xalan-j/apidocs/org/w3c/dom/traversal/NodeIterator.html (279 lines of code) (raw):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc on Thu Nov 22 17:13:00 EST 2007 --> <TITLE> Xalan-Java 2.7.1: Interface NodeIterator </TITLE> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> </HEAD> <BODY BGCOLOR="white"> <!-- ========== START OF NAVBAR ========== --> <A NAME="navbar_top"><!-- --></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/NodeIterator.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../org/w3c/dom/traversal/NodeFilter.html"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../org/w3c/dom/traversal/TreeWalker.html"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="NodeIterator.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: &nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <!-- =========== END OF NAVBAR =========== --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> org.w3c.dom.traversal</FONT> <BR> Interface NodeIterator</H2> <DL> <DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../org/apache/xml/dtm/ref/DTMNodeIterator.html">DTMNodeIterator</A>, <A HREF="../../../../org/apache/xpath/NodeSet.html">NodeSet</A></DD> </DL> <HR> <DL> <DT>public interface <B>NodeIterator</B></DL> <P> <code>NodeIterators</code> are used to step through a set of nodes, e.g. the set of nodes in a <code>NodeList</code>, the document subtree governed by a particular <code>Node</code>, the results of a query, or any other set of nodes. The set of nodes to be iterated is determined by the implementation of the <code>NodeIterator</code>. DOM Level 2 specifies a single <code>NodeIterator</code> implementation for document-order traversal of a document subtree. Instances of these <code>NodeIterators</code> are created by calling <code>DocumentTraversal</code><code>.createNodeIterator()</code>. <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>Document Object Model (DOM) Level 2 Traversal and Range Specification</a>. <P> <DL> <DT><B>Since: </B><DD>DOM Level 2</DD> </DL> <HR> <P> <!-- ======== INNER CLASS SUMMARY ======== --> <!-- =========== FIELD SUMMARY =========== --> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Method Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/traversal/NodeIterator.html#detach()">detach</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Detaches the <code>NodeIterator</code> from the set which it iterated over, releasing any computational resources and placing the <code>NodeIterator</code> in the INVALID state.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/traversal/NodeIterator.html#getExpandEntityReferences()">getExpandEntityReferences</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The value of this flag determines whether the children of entity reference nodes are visible to the <code>NodeIterator</code>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../org/w3c/dom/traversal/NodeFilter.html">NodeFilter</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/traversal/NodeIterator.html#getFilter()">getFilter</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The <code>NodeFilter</code> used to screen nodes.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../org/w3c/dom/Node.html">Node</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/traversal/NodeIterator.html#getRoot()">getRoot</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The root node of the <code>NodeIterator</code>, as specified when it was created.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/traversal/NodeIterator.html#getWhatToShow()">getWhatToShow</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This attribute determines which node types are presented via the <code>NodeIterator</code>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../org/w3c/dom/Node.html">Node</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/traversal/NodeIterator.html#nextNode()">nextNode</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the next node in the set and advances the position of the <code>NodeIterator</code> in the set.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../org/w3c/dom/Node.html">Node</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/w3c/dom/traversal/NodeIterator.html#previousNode()">previousNode</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the previous node in the set and moves the position of the <code>NodeIterator</code> backwards in the set.</TD> </TR> </TABLE> &nbsp; <P> <!-- ============ FIELD DETAIL =========== --> <!-- ========= CONSTRUCTOR DETAIL ======== --> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Method Detail</B></FONT></TD> </TR> </TABLE> <A NAME="getRoot()"><!-- --></A><H3> getRoot</H3> <PRE> public <A HREF="../../../../org/w3c/dom/Node.html">Node</A> <B>getRoot</B>()</PRE> <DL> <DD>The root node of the <code>NodeIterator</code>, as specified when it was created.</DL> <HR> <A NAME="getWhatToShow()"><!-- --></A><H3> getWhatToShow</H3> <PRE> public int <B>getWhatToShow</B>()</PRE> <DL> <DD>This attribute determines which node types are presented via the <code>NodeIterator</code>. The available set of constants is defined in the <code>NodeFilter</code> interface. Nodes not accepted by <code>whatToShow</code> will be skipped, but their children may still be considered. Note that this skip takes precedence over the filter, if any.</DL> <HR> <A NAME="getFilter()"><!-- --></A><H3> getFilter</H3> <PRE> public <A HREF="../../../../org/w3c/dom/traversal/NodeFilter.html">NodeFilter</A> <B>getFilter</B>()</PRE> <DL> <DD>The <code>NodeFilter</code> used to screen nodes.</DL> <HR> <A NAME="getExpandEntityReferences()"><!-- --></A><H3> getExpandEntityReferences</H3> <PRE> public boolean <B>getExpandEntityReferences</B>()</PRE> <DL> <DD>The value of this flag determines whether the children of entity reference nodes are visible to the <code>NodeIterator</code>. If false, these children and their descendants will be rejected. Note that this rejection takes precedence over <code>whatToShow</code> and the filter. Also note that this is currently the only situation where <code>NodeIterators</code> may reject a complete subtree rather than skipping individual nodes. <br> <br> To produce a view of the document that has entity references expanded and does not expose the entity reference node itself, use the <code>whatToShow</code> flags to hide the entity reference node and set <code>expandEntityReferences</code> to true when creating the <code>NodeIterator</code>. To produce a view of the document that has entity reference nodes but no entity expansion, use the <code>whatToShow</code> flags to show the entity reference node and set <code>expandEntityReferences</code> to false.</DL> <HR> <A NAME="nextNode()"><!-- --></A><H3> nextNode</H3> <PRE> public <A HREF="../../../../org/w3c/dom/Node.html">Node</A> <B>nextNode</B>() throws <A HREF="../../../../org/w3c/dom/DOMException.html">DOMException</A></PRE> <DL> <DD>Returns the next node in the set and advances the position of the <code>NodeIterator</code> in the set. After a <code>NodeIterator</code> is created, the first call to <code>nextNode()</code> returns the first node in the set.<DD><DL> <DT><B>Returns:</B><DD>The next <code>Node</code> in the set being iterated over, or <code>null</code> if there are no more members in that set.<DT><B>Throws:</B><DD><A HREF="../../../../org/w3c/dom/DOMException.html">DOMException</A> - INVALID_STATE_ERR: Raised if this method is called after the <code>detach</code> method was invoked.</DL> </DD> </DL> <HR> <A NAME="previousNode()"><!-- --></A><H3> previousNode</H3> <PRE> public <A HREF="../../../../org/w3c/dom/Node.html">Node</A> <B>previousNode</B>() throws <A HREF="../../../../org/w3c/dom/DOMException.html">DOMException</A></PRE> <DL> <DD>Returns the previous node in the set and moves the position of the <code>NodeIterator</code> backwards in the set.<DD><DL> <DT><B>Returns:</B><DD>The previous <code>Node</code> in the set being iterated over, or <code>null</code> if there are no more members in that set.<DT><B>Throws:</B><DD><A HREF="../../../../org/w3c/dom/DOMException.html">DOMException</A> - INVALID_STATE_ERR: Raised if this method is called after the <code>detach</code> method was invoked.</DL> </DD> </DL> <HR> <A NAME="detach()"><!-- --></A><H3> detach</H3> <PRE> public void <B>detach</B>()</PRE> <DL> <DD>Detaches the <code>NodeIterator</code> from the set which it iterated over, releasing any computational resources and placing the <code>NodeIterator</code> in the INVALID state. After <code>detach</code> has been invoked, calls to <code>nextNode</code> or <code>previousNode</code> will raise the exception INVALID_STATE_ERR.</DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ========== START OF NAVBAR ========== --> <A NAME="navbar_bottom"><!-- --></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/NodeIterator.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../org/w3c/dom/traversal/NodeFilter.html"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../org/w3c/dom/traversal/TreeWalker.html"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="NodeIterator.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: &nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <!-- =========== END OF NAVBAR =========== --> <HR> Copyright � 2006 Apache XML Project. All Rights Reserved. </BODY> </HTML>