blob: 3b188c6dfeeef2488837aadd7ece97d5add88a9d [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Thu Nov 22 17:12:56 EST 2007 -->
<TITLE>
Xalan-Java 2.7.1: Interface DTMIterator
</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/DTMIterator.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/apache/xml/dtm/DTMFilter.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/xml/dtm/DTMWSFilter.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="DTMIterator.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;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&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.apache.xml.dtm</FONT>
<BR>
Interface DTMIterator</H2>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../org/apache/xpath/axes/LocPathIterator.html">LocPathIterator</A>, <A HREF="../../../../org/apache/xpath/NodeSetDTM.html">NodeSetDTM</A>, <A HREF="../../../../org/apache/xpath/axes/UnionPathIterator.html">UnionPathIterator</A>, <A HREF="../../../../org/apache/xpath/axes/NodeSequence.html">NodeSequence</A></DD>
</DL>
<HR>
<DL>
<DT>public interface <B>DTMIterator</B></DL>
<P>
<code>DTMIterators</code> are used to step through a (possibly
filtered) set of nodes. Their API is modeled largely after the DOM
NodeIterator.
<p>A DTMIterator is a somewhat unusual type of iterator, in that it
can serve both single node iteration and random access.</p>
<p>The DTMIterator's traversal semantics, i.e. how it walks the tree,
are specified when it is created, possibly and probably by an XPath
<a href="http://www.w3.org/TR/xpath#NT-LocationPath>LocationPath</a> or
a <a href="http://www.w3.org/TR/xpath#NT-UnionExpr">UnionExpr</a>.</p>
<p>A DTMIterator is meant to be created once as a master static object, and
then cloned many times for runtime use. Or the master object itself may
be used for simpler use cases.</p>
<p>At this time, we do not expect DTMIterator to emulate
NodeIterator's "maintain relative position" semantics under
document mutation. It's likely to respond more like the
TreeWalker's "current node" semantics. However, since the base DTM
is immutable, this issue currently makes no practical
difference.</p>
<p>State: In progress!!</p>
<P>
<HR>
<P>
<!-- ======== INNER CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;short</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/xml/dtm/DTMIterator.html#FILTER_ACCEPT">FILTER_ACCEPT</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Accept the node.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;short</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/xml/dtm/DTMIterator.html#FILTER_REJECT">FILTER_REJECT</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reject the node.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;short</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/xml/dtm/DTMIterator.html#FILTER_SKIP">FILTER_SKIP</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Skip this single node.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== 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/apache/xml/dtm/DTMIterator.html#allowDetachToRelease(boolean)">allowDetachToRelease</A></B>(boolean&nbsp;allowRelease)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specify if it's OK for detach to release the iterator for reuse.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/xml/dtm/DTMIterator.html#clone()">clone</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get a clone of this iterator, but don't reset the iteration in the
process, so that it may be used from the current position.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../org/apache/xml/dtm/DTMIterator.html">DTMIterator</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/xml/dtm/DTMIterator.html#cloneWithReset()">cloneWithReset</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get a cloned Iterator that is reset to the start of the iteration.</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/apache/xml/dtm/DTMIterator.html#detach()">detach</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Detaches the <code>DTMIterator</code> from the set which it iterated
over, releasing any computational resources and placing the iterator
in the INVALID state.</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/apache/xml/dtm/DTMIterator.html#getAxis()">getAxis</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the axis being iterated, if it is known.</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/apache/xml/dtm/DTMIterator.html#getCurrentNode()">getCurrentNode</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the current node in the iterator.</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/apache/xml/dtm/DTMIterator.html#getCurrentPos()">getCurrentPos</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the current position within the cached list, which is one
less than the next nextNode() call will retrieve.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../org/apache/xml/dtm/DTM.html">DTM</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/xml/dtm/DTMIterator.html#getDTM(int)">getDTM</A></B>(int&nbsp;nodeHandle)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get an instance of a DTM that "owns" a node handle.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../org/apache/xml/dtm/DTMManager.html">DTMManager</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/xml/dtm/DTMIterator.html#getDTMManager()">getDTMManager</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get an instance of the DTMManager.</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/apache/xml/dtm/DTMIterator.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 iterator.</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/apache/xml/dtm/DTMIterator.html#getLength()">getLength</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The number of nodes in the list.</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/apache/xml/dtm/DTMIterator.html#getRoot()">getRoot</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The root node of the <code>DTMIterator</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/apache/xml/dtm/DTMIterator.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
iterator.</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/apache/xml/dtm/DTMIterator.html#isDocOrdered()">isDocOrdered</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true if all the nodes in the iteration well be returned in document
order.</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/apache/xml/dtm/DTMIterator.html#isFresh()">isFresh</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tells if this NodeSetDTM is "fresh", in other words, if
the first nextNode() that is called will return the
first node in the set.</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/apache/xml/dtm/DTMIterator.html#isMutable()">isMutable</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tells if this iterator can have nodes added to it or set via
the <code>setItem(int node, int index)</code> method.</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/apache/xml/dtm/DTMIterator.html#item(int)">item</A></B>(int&nbsp;index)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the <code>node handle</code> of an item in the collection.</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/apache/xml/dtm/DTMIterator.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
iterator in the set.</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/apache/xml/dtm/DTMIterator.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>DTMIterator</code> backwards in the set.</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/apache/xml/dtm/DTMIterator.html#reset()">reset</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reset the iterator to the start.</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/apache/xml/dtm/DTMIterator.html#runTo(int)">runTo</A></B>(int&nbsp;index)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If an index is requested, NodeSetDTM will call this method
to run the iterator to the index.</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/apache/xml/dtm/DTMIterator.html#setCurrentPos(int)">setCurrentPos</A></B>(int&nbsp;i)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the current position in the node set.</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/apache/xml/dtm/DTMIterator.html#setItem(int, int)">setItem</A></B>(int&nbsp;node,
int&nbsp;index)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the node at the specified index of this vector to be the
specified node.</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/apache/xml/dtm/DTMIterator.html#setRoot(int, java.lang.Object)">setRoot</A></B>(int&nbsp;nodeHandle,
java.lang.Object&nbsp;environment)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reset the root node of the <code>DTMIterator</code>, overriding
the value specified when it was created.</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/apache/xml/dtm/DTMIterator.html#setShouldCacheNodes(boolean)">setShouldCacheNodes</A></B>(boolean&nbsp;b)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If setShouldCacheNodes(true) is called, then nodes will
be cached, enabling random access, and giving the ability to do
sorts and the like.</TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="FILTER_ACCEPT"><!-- --></A><H3>
FILTER_ACCEPT</H3>
<PRE>
public static final short <B>FILTER_ACCEPT</B></PRE>
<DL>
<DD>Accept the node.</DL>
<HR>
<A NAME="FILTER_REJECT"><!-- --></A><H3>
FILTER_REJECT</H3>
<PRE>
public static final short <B>FILTER_REJECT</B></PRE>
<DL>
<DD>Reject the node. Same behavior as FILTER_SKIP. (In the DOM these
differ when applied to a TreeWalker but have the same result when
applied to a NodeIterator).</DL>
<HR>
<A NAME="FILTER_SKIP"><!-- --></A><H3>
FILTER_SKIP</H3>
<PRE>
public static final short <B>FILTER_SKIP</B></PRE>
<DL>
<DD>Skip this single node.</DL>
<!-- ========= 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="getDTM(int)"><!-- --></A><H3>
getDTM</H3>
<PRE>
public <A HREF="../../../../org/apache/xml/dtm/DTM.html">DTM</A> <B>getDTM</B>(int&nbsp;nodeHandle)</PRE>
<DL>
<DD>Get an instance of a DTM that "owns" a node handle. Since a node
iterator may be passed without a DTMManager, this allows the
caller to easily get the DTM using just the iterator.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>nodeHandle</CODE> - the nodeHandle.<DT><B>Returns:</B><DD>a non-null DTM reference.</DL>
</DD>
</DL>
<HR>
<A NAME="getDTMManager()"><!-- --></A><H3>
getDTMManager</H3>
<PRE>
public <A HREF="../../../../org/apache/xml/dtm/DTMManager.html">DTMManager</A> <B>getDTMManager</B>()</PRE>
<DL>
<DD>Get an instance of the DTMManager. Since a node
iterator may be passed without a DTMManager, this allows the
caller to easily get the DTMManager using just the iterator.<DD><DL>
<DT><B>Returns:</B><DD>a non-null DTMManager reference.</DL>
</DD>
</DL>
<HR>
<A NAME="getRoot()"><!-- --></A><H3>
getRoot</H3>
<PRE>
public int <B>getRoot</B>()</PRE>
<DL>
<DD>The root node of the <code>DTMIterator</code>, as specified when it
was created. Note the root node is not the root node of the
document tree, but the context node from where the iteration
begins and ends.<DD><DL>
<DT><B>Returns:</B><DD>nodeHandle int Handle of the context node.</DL>
</DD>
</DL>
<HR>
<A NAME="setRoot(int, java.lang.Object)"><!-- --></A><H3>
setRoot</H3>
<PRE>
public void <B>setRoot</B>(int&nbsp;nodeHandle,
java.lang.Object&nbsp;environment)</PRE>
<DL>
<DD>Reset the root node of the <code>DTMIterator</code>, overriding
the value specified when it was created. Note the root node is
not the root node of the document tree, but the context node from
where the iteration begins.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>nodeHandle</CODE> - int Handle of the context node.<DD><CODE>environment</CODE> - The environment object.
The environment in which this iterator operates, which should provide:
<ul>
<li>a node (the context node... same value as "root" defined below) </li>
<li>a pair of non-zero positive integers (the context position and the context size) </li>
<li>a set of variable bindings </li>
<li>a function library </li>
<li>the set of namespace declarations in scope for the expression.</li>
<ul>
<p>At this time the exact implementation of this environment is application
dependent. Probably a proper interface will be created fairly soon.</p></DL>
</DD>
</DL>
<HR>
<A NAME="reset()"><!-- --></A><H3>
reset</H3>
<PRE>
public void <B>reset</B>()</PRE>
<DL>
<DD>Reset the iterator to the start. After resetting, the next node returned
will be the root node -- or, if that's filtered out, the first node
within the root's subtree which is _not_ skipped by the filters.</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
iterator. The available set of constants is defined above.
Nodes not accepted by
<code>whatToShow</code> will be skipped, but their children may still
be considered.<DD><DL>
<DT><B>Returns:</B><DD>one of the SHOW_XXX constants, or several ORed together.</DL>
</DD>
</DL>
<HR>
<A NAME="getExpandEntityReferences()"><!-- --></A><H3>
getExpandEntityReferences</H3>
<PRE>
public boolean <B>getExpandEntityReferences</B>()</PRE>
<DL>
<DD><p>The value of this flag determines whether the children of entity
reference nodes are visible to the iterator. If false, they and
their descendants will be rejected. Note that this rejection takes
precedence over <code>whatToShow</code> and the filter. </p>
<p> 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
iterator. 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.</p>
<p>NOTE: In Xalan's use of DTM we will generally have fully expanded
entity references when the document tree was built, and thus this
flag will have no effect.</p><DD><DL>
<DT><B>Returns:</B><DD>true if entity references will be expanded.</DL>
</DD>
</DL>
<HR>
<A NAME="nextNode()"><!-- --></A><H3>
nextNode</H3>
<PRE>
public int <B>nextNode</B>()</PRE>
<DL>
<DD>Returns the next node in the set and advances the position of the
iterator in the set. After a <code>DTMIterator</code> has setRoot called,
the first call to <code>nextNode()</code> returns that root or (if it
is rejected by the filters) the first node within its subtree which is
not filtered out.<DD><DL>
<DT><B>Returns:</B><DD>The next node handle in the set being iterated over, or
<code>DTM.NULL</code> if there are no more members in that set.</DL>
</DD>
</DL>
<HR>
<A NAME="previousNode()"><!-- --></A><H3>
previousNode</H3>
<PRE>
public int <B>previousNode</B>()</PRE>
<DL>
<DD>Returns the previous node in the set and moves the position of the
<code>DTMIterator</code> backwards in the set.<DD><DL>
<DT><B>Returns:</B><DD>The previous node handle in the set being iterated over,
or <code>DTM.NULL</code> if there are no more members in that set.</DL>
</DD>
</DL>
<HR>
<A NAME="detach()"><!-- --></A><H3>
detach</H3>
<PRE>
public void <B>detach</B>()</PRE>
<DL>
<DD>Detaches the <code>DTMIterator</code> from the set which it iterated
over, releasing any computational resources and placing the iterator
in the INVALID state. After <code>detach</code> has been invoked,
calls to <code>nextNode</code> or <code>previousNode</code> will
raise a runtime exception.</DL>
<HR>
<A NAME="allowDetachToRelease(boolean)"><!-- --></A><H3>
allowDetachToRelease</H3>
<PRE>
public void <B>allowDetachToRelease</B>(boolean&nbsp;allowRelease)</PRE>
<DL>
<DD>Specify if it's OK for detach to release the iterator for reuse.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>allowRelease</CODE> - true if it is OK for detach to release this iterator
for pooling.</DL>
</DD>
</DL>
<HR>
<A NAME="getCurrentNode()"><!-- --></A><H3>
getCurrentNode</H3>
<PRE>
public int <B>getCurrentNode</B>()</PRE>
<DL>
<DD>Get the current node in the iterator. Note that this differs from
the DOM's NodeIterator, where the current position lies between two
nodes (as part of the maintain-relative-position semantic).<DD><DL>
<DT><B>Returns:</B><DD>The current node handle, or -1.</DL>
</DD>
</DL>
<HR>
<A NAME="isFresh()"><!-- --></A><H3>
isFresh</H3>
<PRE>
public boolean <B>isFresh</B>()</PRE>
<DL>
<DD>Tells if this NodeSetDTM is "fresh", in other words, if
the first nextNode() that is called will return the
first node in the set.<DD><DL>
<DT><B>Returns:</B><DD>true if the iteration of this list has not yet begun.</DL>
</DD>
</DL>
<HR>
<A NAME="setShouldCacheNodes(boolean)"><!-- --></A><H3>
setShouldCacheNodes</H3>
<PRE>
public void <B>setShouldCacheNodes</B>(boolean&nbsp;b)</PRE>
<DL>
<DD>If setShouldCacheNodes(true) is called, then nodes will
be cached, enabling random access, and giving the ability to do
sorts and the like. They are not cached by default.
%REVIEW% Shouldn't the other random-access methods throw an exception
if they're called on a DTMIterator with this flag set false?<DD><DL>
<DT><B>Parameters:</B><DD><CODE>b</CODE> - true if the nodes should be cached.</DL>
</DD>
</DL>
<HR>
<A NAME="isMutable()"><!-- --></A><H3>
isMutable</H3>
<PRE>
public boolean <B>isMutable</B>()</PRE>
<DL>
<DD>Tells if this iterator can have nodes added to it or set via
the <code>setItem(int node, int index)</code> method.<DD><DL>
<DT><B>Returns:</B><DD>True if the nodelist can be mutated.</DL>
</DD>
</DL>
<HR>
<A NAME="getCurrentPos()"><!-- --></A><H3>
getCurrentPos</H3>
<PRE>
public int <B>getCurrentPos</B>()</PRE>
<DL>
<DD>Get the current position within the cached list, which is one
less than the next nextNode() call will retrieve. i.e. if you
call getCurrentPos() and the return is 0, the next fetch will
take place at index 1.<DD><DL>
<DT><B>Returns:</B><DD>The position of the iteration.</DL>
</DD>
</DL>
<HR>
<A NAME="runTo(int)"><!-- --></A><H3>
runTo</H3>
<PRE>
public void <B>runTo</B>(int&nbsp;index)</PRE>
<DL>
<DD>If an index is requested, NodeSetDTM will call this method
to run the iterator to the index. By default this sets
m_next to the index. If the index argument is -1, this
signals that the iterator should be run to the end and
completely fill the cache.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>index</CODE> - The index to run to, or -1 if the iterator should be run
to the end.</DL>
</DD>
</DL>
<HR>
<A NAME="setCurrentPos(int)"><!-- --></A><H3>
setCurrentPos</H3>
<PRE>
public void <B>setCurrentPos</B>(int&nbsp;i)</PRE>
<DL>
<DD>Set the current position in the node set.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>i</CODE> - Must be a valid index.</DL>
</DD>
</DL>
<HR>
<A NAME="item(int)"><!-- --></A><H3>
item</H3>
<PRE>
public int <B>item</B>(int&nbsp;index)</PRE>
<DL>
<DD>Returns the <code>node handle</code> of an item in the collection. If
<code>index</code> is greater than or equal to the number of nodes in
the list, this returns <code>null</code>.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>index</CODE> - of the item.<DT><B>Returns:</B><DD>The node handle at the <code>index</code>th position in the
<code>DTMIterator</code>, or <code>-1</code> if that is not a valid
index.</DL>
</DD>
</DL>
<HR>
<A NAME="setItem(int, int)"><!-- --></A><H3>
setItem</H3>
<PRE>
public void <B>setItem</B>(int&nbsp;node,
int&nbsp;index)</PRE>
<DL>
<DD>Sets the node at the specified index of this vector to be the
specified node. The previous component at that position is discarded.
<p>The index must be a value greater than or equal to 0 and less
than the current size of the vector.
The iterator must be in cached mode.</p>
<p>Meant to be used for sorted iterators.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>node</CODE> - Node to set<DD><CODE>index</CODE> - Index of where to set the node</DL>
</DD>
</DL>
<HR>
<A NAME="getLength()"><!-- --></A><H3>
getLength</H3>
<PRE>
public int <B>getLength</B>()</PRE>
<DL>
<DD>The number of nodes in the list. The range of valid child node indices
is 0 to <code>length-1</code> inclusive. Note that this requires running
the iterator to completion, and presumably filling the cache.<DD><DL>
<DT><B>Returns:</B><DD>The number of nodes in the list.</DL>
</DD>
</DL>
<HR>
<A NAME="cloneWithReset()"><!-- --></A><H3>
cloneWithReset</H3>
<PRE>
public <A HREF="../../../../org/apache/xml/dtm/DTMIterator.html">DTMIterator</A> <B>cloneWithReset</B>()
throws java.lang.CloneNotSupportedException</PRE>
<DL>
<DD>Get a cloned Iterator that is reset to the start of the iteration.<DD><DL>
<DT><B>Returns:</B><DD>A clone of this iteration that has been reset.<DT><B>Throws:</B><DD>java.lang.CloneNotSupportedException - &nbsp;</DL>
</DD>
</DL>
<HR>
<A NAME="clone()"><!-- --></A><H3>
clone</H3>
<PRE>
public java.lang.Object <B>clone</B>()
throws java.lang.CloneNotSupportedException</PRE>
<DL>
<DD>Get a clone of this iterator, but don't reset the iteration in the
process, so that it may be used from the current position.<DD><DL>
<DT><B>Returns:</B><DD>A clone of this object.<DT><B>Throws:</B><DD>java.lang.CloneNotSupportedException - &nbsp;</DL>
</DD>
</DL>
<HR>
<A NAME="isDocOrdered()"><!-- --></A><H3>
isDocOrdered</H3>
<PRE>
public boolean <B>isDocOrdered</B>()</PRE>
<DL>
<DD>Returns true if all the nodes in the iteration well be returned in document
order.<DD><DL>
<DT><B>Returns:</B><DD>true if all the nodes in the iteration well be returned in document
order.</DL>
</DD>
</DL>
<HR>
<A NAME="getAxis()"><!-- --></A><H3>
getAxis</H3>
<PRE>
public int <B>getAxis</B>()</PRE>
<DL>
<DD>Returns the axis being iterated, if it is known.<DD><DL>
<DT><B>Returns:</B><DD>Axis.CHILD, etc., or -1 if the axis is not known or is of multiple
types.</DL>
</DD>
</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/DTMIterator.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/apache/xml/dtm/DTMFilter.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/xml/dtm/DTMWSFilter.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="DTMIterator.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;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&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>