<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.4.2_05) on Mon Nov 08 21:00:50 EST 2004 --> <TITLE> StoredIterator (Sleepycat Software, Inc. - Berkeley DB Java API) </TITLE> <META NAME="keywords" CONTENT="com.sleepycat.collections.StoredIterator class"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../style.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="StoredIterator (Sleepycat Software, Inc. - Berkeley DB Java API)"; } </SCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/StoredIterator.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>Berkeley DB</b><br><font size="-1"> version 4.3.21</font></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../com/sleepycat/collections/StoredEntrySet.html" title="class in com.sleepycat.collections"><B>PREV CLASS</B></A> <A HREF="../../../com/sleepycat/collections/StoredKeySet.html" title="class in com.sleepycat.collections"><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> <A HREF="StoredIterator.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> com.sleepycat.collections</FONT> <BR> Class StoredIterator</H2> <PRE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">java.lang.Object</A> <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><B>com.sleepycat.collections.StoredIterator</B> </PRE> <DL> <DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Cloneable.html" title="class or interface in java.lang">Cloneable</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html" title="class or interface in java.util">Iterator</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html" title="class or interface in java.util">ListIterator</A></DD> </DL> <HR> <DL> <DT>public class <B>StoredIterator</B><DT>extends <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A><DT>implements <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html" title="class or interface in java.util">ListIterator</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Cloneable.html" title="class or interface in java.lang">Cloneable</A></DL> <P> The Iterator returned by all stored collections. <p>While in general this class conforms to the <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html" title="class or interface in java.util"><CODE>Iterator</CODE></A> interface, it is important to note that all iterators for stored collections must be explicitly closed with <A HREF="../../../com/sleepycat/collections/StoredIterator.html#close()"><CODE>close()</CODE></A>. The static method <A HREF="../../../com/sleepycat/collections/StoredIterator.html#close(java.util.Iterator)"><CODE>close(java.util.Iterator)</CODE></A> allows calling close for all iterators without harm to iterators that are not from stored collections, and also avoids casting. If a stored iterator is not closed, unpredictable behavior including process death may result.</p> <p>This class implements the <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html" title="class or interface in java.util"><CODE>Iterator</CODE></A> interface for all stored iterators. It also implements <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html" title="class or interface in java.util"><CODE>ListIterator</CODE></A> because some list iterator methods apply to all stored iterators, for example, <A HREF="../../../com/sleepycat/collections/StoredIterator.html#previous()"><CODE>previous()</CODE></A> and <A HREF="../../../com/sleepycat/collections/StoredIterator.html#hasPrevious()"><CODE>hasPrevious()</CODE></A>. Other list iterator methods are always supported for lists, but for other types of collections are only supported under certain conditions. See <A HREF="../../../com/sleepycat/collections/StoredIterator.html#nextIndex()"><CODE>nextIndex()</CODE></A>, <A HREF="../../../com/sleepycat/collections/StoredIterator.html#previousIndex()"><CODE>previousIndex()</CODE></A>, <A HREF="../../../com/sleepycat/collections/StoredIterator.html#add(java.lang.Object)"><CODE>add(java.lang.Object)</CODE></A> and <A HREF="../../../com/sleepycat/collections/StoredIterator.html#set(java.lang.Object)"><CODE>set(java.lang.Object)</CODE></A> for details.</p> <p>In addition, this class provides the following methods for stored collection iterators only. Note that the use of these methods is not compatible with the standard Java collections interface.</p> <ul> <li><A HREF="../../../com/sleepycat/collections/StoredIterator.html#close()"><CODE>close()</CODE></A></li> <li><A HREF="../../../com/sleepycat/collections/StoredIterator.html#close(java.util.Iterator)"><CODE>close(Iterator)</CODE></A></li> <li><A HREF="../../../com/sleepycat/collections/StoredIterator.html#getCollection()"><CODE>getCollection()</CODE></A></li> <li><A HREF="../../../com/sleepycat/collections/StoredIterator.html#setReadModifyWrite(boolean)"><CODE>setReadModifyWrite(boolean)</CODE></A></li> <li><A HREF="../../../com/sleepycat/collections/StoredIterator.html#isReadModifyWrite()"><CODE>isReadModifyWrite()</CODE></A></li> </ul> <P> <P> <HR> <P> <!-- ======== NESTED CLASS SUMMARY ======== --> <!-- =========== FIELD SUMMARY =========== --> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <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> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/collections/StoredIterator.html#add(java.lang.Object)">add</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> value)</CODE> <BR> Inserts the specified element into the list or inserts a duplicate into other types of collections (optional operation).</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/collections/StoredIterator.html#close()">close</A></B>()</CODE> <BR> Closes this iterator.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/collections/StoredIterator.html#close(java.util.Iterator)">close</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html" title="class or interface in java.util">Iterator</A> i)</CODE> <BR> Closes the given iterator using <A HREF="../../../com/sleepycat/collections/StoredIterator.html#close()"><CODE>close()</CODE></A> if it is a <A HREF="../../../com/sleepycat/collections/StoredIterator.html" title="class in com.sleepycat.collections"><CODE>StoredIterator</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/collections/StoredIterator.html#count()">count</A></B>()</CODE> <BR> Returns the number of elements having the same key value as the key value of the element last returned by next() or previous().</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/collections/StoredCollection.html" title="class in com.sleepycat.collections">StoredCollection</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/collections/StoredIterator.html#getCollection()">getCollection</A></B>()</CODE> <BR> Returns the collection associated with this iterator.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/collections/StoredIterator.html#hasNext()">hasNext</A></B>()</CODE> <BR> Returns true if this iterator has more elements when traversing in the forward direction.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/collections/StoredIterator.html#hasPrevious()">hasPrevious</A></B>()</CODE> <BR> Returns true if this iterator has more elements when traversing in the reverse direction.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/collections/StoredIterator.html#isReadModifyWrite()">isReadModifyWrite</A></B>()</CODE> <BR> Returns whether write-locks will be obtained when reading with this cursor.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/collections/StoredIterator.html#next()">next</A></B>()</CODE> <BR> Returns the next element in the iteration.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/collections/StoredIterator.html#nextIndex()">nextIndex</A></B>()</CODE> <BR> Returns the index of the element that would be returned by a subsequent call to next.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/collections/StoredIterator.html#previous()">previous</A></B>()</CODE> <BR> Returns the next element in the iteration.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/collections/StoredIterator.html#previousIndex()">previousIndex</A></B>()</CODE> <BR> Returns the index of the element that would be returned by a subsequent call to previous.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/collections/StoredIterator.html#remove()">remove</A></B>()</CODE> <BR> Removes the last element that was returned by next or previous (optional operation).</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/collections/StoredIterator.html#set(java.lang.Object)">set</A></B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> value)</CODE> <BR> Replaces the last element returned by next or previous with the specified element (optional operation).</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/collections/StoredIterator.html#setReadModifyWrite(boolean)">setReadModifyWrite</A></B>(boolean lockForWrite)</CODE> <BR> Changes whether write-locks will be obtained when reading with this cursor.</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> </TR> </TABLE> <P> <!-- ============ FIELD DETAIL =========== --> <!-- ========= CONSTRUCTOR DETAIL ======== --> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Method Detail</B></FONT></TD> </TR> </TABLE> <A NAME="close(java.util.Iterator)"><!-- --></A><H3> close</H3> <PRE> public static void <B>close</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html" title="class or interface in java.util">Iterator</A> i)</PRE> <DL> <DD>Closes the given iterator using <A HREF="../../../com/sleepycat/collections/StoredIterator.html#close()"><CODE>close()</CODE></A> if it is a <A HREF="../../../com/sleepycat/collections/StoredIterator.html" title="class in com.sleepycat.collections"><CODE>StoredIterator</CODE></A>. If the given iterator is not a <A HREF="../../../com/sleepycat/collections/StoredIterator.html" title="class in com.sleepycat.collections"><CODE>StoredIterator</CODE></A>, this method does nothing. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>i</CODE> - is the iterator to close. <DT><B>Throws:</B> <DD><CODE>RuntimeExceptionWrapper</CODE> - if a <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db"><CODE>DatabaseException</CODE></A> is thrown.</DL> </DD> </DL> <HR> <A NAME="isReadModifyWrite()"><!-- --></A><H3> isReadModifyWrite</H3> <PRE> public final boolean <B>isReadModifyWrite</B>()</PRE> <DL> <DD>Returns whether write-locks will be obtained when reading with this cursor. Obtaining write-locks can prevent deadlocks when reading and then modifying data. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the write-lock setting.</DL> </DD> </DL> <HR> <A NAME="setReadModifyWrite(boolean)"><!-- --></A><H3> setReadModifyWrite</H3> <PRE> public void <B>setReadModifyWrite</B>(boolean lockForWrite)</PRE> <DL> <DD>Changes whether write-locks will be obtained when reading with this cursor. Obtaining write-locks can prevent deadlocks when reading and then modifying data. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>lockForWrite</CODE> - the write-lock setting.</DL> </DD> </DL> <HR> <A NAME="hasNext()"><!-- --></A><H3> hasNext</H3> <PRE> public boolean <B>hasNext</B>()</PRE> <DL> <DD>Returns true if this iterator has more elements when traversing in the forward direction. False is returned if the iterator has been closed. This method conforms to the <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html#hasNext()" title="class or interface in java.util"><CODE>Iterator.hasNext()</CODE></A> interface. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html#hasNext()" title="class or interface in java.util">hasNext</A></CODE> in interface <CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html" title="class or interface in java.util">ListIterator</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>whether <A HREF="../../../com/sleepycat/collections/StoredIterator.html#next()"><CODE>next()</CODE></A> will succeed. <DT><B>Throws:</B> <DD><CODE>RuntimeExceptionWrapper</CODE> - if a <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db"><CODE>DatabaseException</CODE></A> is thrown.</DL> </DD> </DL> <HR> <A NAME="hasPrevious()"><!-- --></A><H3> hasPrevious</H3> <PRE> public boolean <B>hasPrevious</B>()</PRE> <DL> <DD>Returns true if this iterator has more elements when traversing in the reverse direction. It returns false if the iterator has been closed. This method conforms to the <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html#hasPrevious()" title="class or interface in java.util"><CODE>ListIterator.hasPrevious()</CODE></A> interface. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html#hasPrevious()" title="class or interface in java.util">hasPrevious</A></CODE> in interface <CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html" title="class or interface in java.util">ListIterator</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>whether <A HREF="../../../com/sleepycat/collections/StoredIterator.html#previous()"><CODE>previous()</CODE></A> will succeed. <DT><B>Throws:</B> <DD><CODE>RuntimeExceptionWrapper</CODE> - if a <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db"><CODE>DatabaseException</CODE></A> is thrown.</DL> </DD> </DL> <HR> <A NAME="next()"><!-- --></A><H3> next</H3> <PRE> public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>next</B>()</PRE> <DL> <DD>Returns the next element in the iteration. This method conforms to the <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html#next()" title="class or interface in java.util"><CODE>Iterator.next()</CODE></A> interface. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html#next()" title="class or interface in java.util">next</A></CODE> in interface <CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html" title="class or interface in java.util">ListIterator</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the next element. <DT><B>Throws:</B> <DD><CODE>RuntimeExceptionWrapper</CODE> - if a <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db"><CODE>DatabaseException</CODE></A> is thrown.</DL> </DD> </DL> <HR> <A NAME="previous()"><!-- --></A><H3> previous</H3> <PRE> public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>previous</B>()</PRE> <DL> <DD>Returns the next element in the iteration. This method conforms to the <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html#previous()" title="class or interface in java.util"><CODE>ListIterator.previous()</CODE></A> interface. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html#previous()" title="class or interface in java.util">previous</A></CODE> in interface <CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html" title="class or interface in java.util">ListIterator</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the previous element. <DT><B>Throws:</B> <DD><CODE>RuntimeExceptionWrapper</CODE> - if a <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db"><CODE>DatabaseException</CODE></A> is thrown.</DL> </DD> </DL> <HR> <A NAME="nextIndex()"><!-- --></A><H3> nextIndex</H3> <PRE> public int <B>nextIndex</B>()</PRE> <DL> <DD>Returns the index of the element that would be returned by a subsequent call to next. This method conforms to the <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html#nextIndex()" title="class or interface in java.util"><CODE>ListIterator.nextIndex()</CODE></A> interface except that it returns Integer.MAX_VALUE for stored lists when positioned at the end of the list, rather than returning the list size as specified by the ListIterator interface. This is because the database size is not available. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html#nextIndex()" title="class or interface in java.util">nextIndex</A></CODE> in interface <CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html" title="class or interface in java.util">ListIterator</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the next index. <DT><B>Throws:</B> <DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/UnsupportedOperationException.html" title="class or interface in java.lang">UnsupportedOperationException</A></CODE> - if this iterator's collection does not use record number keys. <DD><CODE>RuntimeExceptionWrapper</CODE> - if a <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db"><CODE>DatabaseException</CODE></A> is thrown.</DL> </DD> </DL> <HR> <A NAME="previousIndex()"><!-- --></A><H3> previousIndex</H3> <PRE> public int <B>previousIndex</B>()</PRE> <DL> <DD>Returns the index of the element that would be returned by a subsequent call to previous. This method conforms to the <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html#previousIndex()" title="class or interface in java.util"><CODE>ListIterator.previousIndex()</CODE></A> interface. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html#previousIndex()" title="class or interface in java.util">previousIndex</A></CODE> in interface <CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html" title="class or interface in java.util">ListIterator</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the previous index. <DT><B>Throws:</B> <DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/UnsupportedOperationException.html" title="class or interface in java.lang">UnsupportedOperationException</A></CODE> - if this iterator's collection does not use record number keys. <DD><CODE>RuntimeExceptionWrapper</CODE> - if a <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db"><CODE>DatabaseException</CODE></A> is thrown.</DL> </DD> </DL> <HR> <A NAME="set(java.lang.Object)"><!-- --></A><H3> set</H3> <PRE> public void <B>set</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> value)</PRE> <DL> <DD>Replaces the last element returned by next or previous with the specified element (optional operation). This method conforms to the <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html#set(java.lang.Object)" title="class or interface in java.util"><CODE>ListIterator.set(java.lang.Object)</CODE></A> interface. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html#set(java.lang.Object)" title="class or interface in java.util">set</A></CODE> in interface <CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html" title="class or interface in java.util">ListIterator</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>value</CODE> - the new value. <DT><B>Throws:</B> <DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/UnsupportedOperationException.html" title="class or interface in java.lang">UnsupportedOperationException</A></CODE> - if the collection is a <A HREF="../../../com/sleepycat/collections/StoredKeySet.html" title="class in com.sleepycat.collections"><CODE>StoredKeySet</CODE></A> (the set returned by <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Map.html#keySet()" title="class or interface in java.util"><CODE>Map.keySet()</CODE></A>), or if duplicates are sorted since this would change the iterator position, or if the collection is indexed, or if the collection is read-only. <DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if an entity value binding is used and the primary key of the value given is different than the existing stored primary key. <DD><CODE>RuntimeExceptionWrapper</CODE> - if a <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db"><CODE>DatabaseException</CODE></A> is thrown.</DL> </DD> </DL> <HR> <A NAME="remove()"><!-- --></A><H3> remove</H3> <PRE> public void <B>remove</B>()</PRE> <DL> <DD>Removes the last element that was returned by next or previous (optional operation). This method conforms to the <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html#remove()" title="class or interface in java.util"><CODE>ListIterator.remove()</CODE></A> interface except that when the collection is a list and the RECNO-RENUMBER access method is not used, list indices will not be renumbered. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html#remove()" title="class or interface in java.util">remove</A></CODE> in interface <CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html" title="class or interface in java.util">ListIterator</A></CODE></DL> </DD> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/UnsupportedOperationException.html" title="class or interface in java.lang">UnsupportedOperationException</A></CODE> - if the collection is a sublist, or if the collection is read-only. <DD><CODE>RuntimeExceptionWrapper</CODE> - if a <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db"><CODE>DatabaseException</CODE></A> is thrown.</DL> </DD> </DL> <HR> <A NAME="add(java.lang.Object)"><!-- --></A><H3> add</H3> <PRE> public void <B>add</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> value)</PRE> <DL> <DD>Inserts the specified element into the list or inserts a duplicate into other types of collections (optional operation). This method conforms to the <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html#add(java.lang.Object)" title="class or interface in java.util"><CODE>ListIterator.add(java.lang.Object)</CODE></A> interface when the collection is a list and the RECNO-RENUMBER access method is used. Otherwise, this method may only be called when duplicates are allowed. If duplicates are unsorted, the new value will be inserted in the same manner as list elements. If duplicates are sorted, the new value will be inserted in sort order. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html#add(java.lang.Object)" title="class or interface in java.util">add</A></CODE> in interface <CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html" title="class or interface in java.util">ListIterator</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>value</CODE> - the new value. <DT><B>Throws:</B> <DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/UnsupportedOperationException.html" title="class or interface in java.lang">UnsupportedOperationException</A></CODE> - if the collection is a sublist, or if the collection is indexed, or if the collection is read-only, or if the collection is a list and the RECNO-RENUMBER access method was not used, or if the collection is not a list and duplicates are not allowed. <DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the collection is empty and is not a list with RECNO-RENUMBER access. <DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if a duplicate value is being added that already exists and duplicates are sorted. <DD><CODE>RuntimeExceptionWrapper</CODE> - if a <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db"><CODE>DatabaseException</CODE></A> is thrown.</DL> </DD> </DL> <HR> <A NAME="count()"><!-- --></A><H3> count</H3> <PRE> public int <B>count</B>()</PRE> <DL> <DD>Returns the number of elements having the same key value as the key value of the element last returned by next() or previous(). If no duplicates are allowed, 1 is always returned. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the number of duplicates. <DT><B>Throws:</B> <DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if next() or previous() has not been called for this iterator, or if remove() or add() were called after the last call to next() or previous().</DL> </DD> </DL> <HR> <A NAME="close()"><!-- --></A><H3> close</H3> <PRE> public void <B>close</B>()</PRE> <DL> <DD>Closes this iterator. This method does not exist in the standard <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html" title="class or interface in java.util"><CODE>Iterator</CODE></A> or <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html" title="class or interface in java.util"><CODE>ListIterator</CODE></A> interfaces. <p>After being closed, only the <A HREF="../../../com/sleepycat/collections/StoredIterator.html#hasNext()"><CODE>hasNext()</CODE></A> and <A HREF="../../../com/sleepycat/collections/StoredIterator.html#hasPrevious()"><CODE>hasPrevious()</CODE></A> methods may be called and these will return false. <A HREF="../../../com/sleepycat/collections/StoredIterator.html#close()"><CODE>close()</CODE></A> may also be called again and will do nothing. If other methods are called a <code>NullPointerException</code> will generally be thrown.</p> <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Throws:</B> <DD><CODE>RuntimeExceptionWrapper</CODE> - if a <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db"><CODE>DatabaseException</CODE></A> is thrown.</DL> </DD> </DL> <HR> <A NAME="getCollection()"><!-- --></A><H3> getCollection</H3> <PRE> public final <A HREF="../../../com/sleepycat/collections/StoredCollection.html" title="class in com.sleepycat.collections">StoredCollection</A> <B>getCollection</B>()</PRE> <DL> <DD>Returns the collection associated with this iterator. This method does not exist in the standard <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html" title="class or interface in java.util"><CODE>Iterator</CODE></A> or <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/ListIterator.html" title="class or interface in java.util"><CODE>ListIterator</CODE></A> interfaces. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the collection associated with this iterator.</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/StoredIterator.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>Berkeley DB</b><br><font size="-1"> version 4.3.21</font></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../com/sleepycat/collections/StoredEntrySet.html" title="class in com.sleepycat.collections"><B>PREV CLASS</B></A> <A HREF="../../../com/sleepycat/collections/StoredKeySet.html" title="class in com.sleepycat.collections"><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> <A HREF="StoredIterator.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <font size=1><a href="../../../../sleepycat/legal.html">Copyright (c) 1996-2004</a> <a href="http://www.sleepycat.com">Sleepycat Software, Inc.</a> - All rights reserved.</font> </BODY> </HTML>