<!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.6.0_0) on Wed Dec 30 04:50:33 EST 2009 --> <TITLE> EntityCursor </TITLE> <META NAME="date" CONTENT="2009-12-30"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="EntityCursor"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= 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=2 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="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> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../com/sleepycat/persist/DatabaseNamer.html" title="interface in com.sleepycat.persist"><B>PREV CLASS</B></A> <A HREF="../../../com/sleepycat/persist/EntityIndex.html" title="interface in com.sleepycat.persist"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?com/sleepycat/persist/EntityCursor.html" target="_top"><B>FRAMES</B></A> <A HREF="EntityCursor.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.persist</FONT> <BR> Interface EntityCursor<V></H2> <DL> <DT><B>All Superinterfaces:</B> <DD><A HREF="../../../com/sleepycat/persist/ForwardCursor.html" title="interface in com.sleepycat.persist">ForwardCursor</A><V>, java.lang.Iterable<V></DD> </DL> <HR> <DL> <DT><PRE>public interface <B>EntityCursor<V></B><DT>extends <A HREF="../../../com/sleepycat/persist/ForwardCursor.html" title="interface in com.sleepycat.persist">ForwardCursor</A><V></DL> </PRE> <P> Traverses entity values or key values and allows deleting or updating the entity at the current cursor position. The value type (V) is either an entity class or a key class, depending on how the cursor was opened. <p><code>EntityCursor</code> objects are <em>not</em> thread-safe. Cursors should be opened, used and closed by a single thread.</p> <p>Cursors are opened using the <A HREF="../../../com/sleepycat/persist/EntityIndex.html#keys()"><CODE>EntityIndex.keys()</CODE></A> and <A HREF="../../../com/sleepycat/persist/EntityIndex.html#entities()"><CODE>EntityIndex.entities()</CODE></A> family of methods. These methods are available for objects of any class that implements <A HREF="../../../com/sleepycat/persist/EntityIndex.html" title="interface in com.sleepycat.persist"><CODE>EntityIndex</CODE></A>: <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="class in com.sleepycat.persist"><CODE>PrimaryIndex</CODE></A>, <A HREF="../../../com/sleepycat/persist/SecondaryIndex.html" title="class in com.sleepycat.persist"><CODE>SecondaryIndex</CODE></A>, and the indices returned by <A HREF="../../../com/sleepycat/persist/SecondaryIndex.html#keysIndex"><CODE>SecondaryIndex.keysIndex</CODE></A> and <A HREF="../../../com/sleepycat/persist/SecondaryIndex.html#subIndex(SK)"><CODE>SecondaryIndex.subIndex(SK)</CODE></A>. A <A HREF="../../../com/sleepycat/persist/ForwardCursor.html" title="interface in com.sleepycat.persist"><CODE>ForwardCursor</CODE></A>, which implements a subset of cursor operations, is also available via the <A HREF="../../../com/sleepycat/persist/EntityJoin.html#keys()"><CODE>EntityJoin.keys()</CODE></A> and <A HREF="../../../com/sleepycat/persist/EntityJoin.html#entities()"><CODE>EntityJoin.entities()</CODE></A> methods.</p> <p>Values are always returned by a cursor in key order, where the key is defined by the underlying <A HREF="../../../com/sleepycat/persist/EntityIndex.html" title="interface in com.sleepycat.persist"><CODE>EntityIndex</CODE></A>. For example, a cursor on a <A HREF="../../../com/sleepycat/persist/SecondaryIndex.html" title="class in com.sleepycat.persist"><CODE>SecondaryIndex</CODE></A> returns values ordered by secondary key, while an index on a <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="class in com.sleepycat.persist"><CODE>PrimaryIndex</CODE></A> or a <A HREF="../../../com/sleepycat/persist/SecondaryIndex.html#subIndex(SK)"><CODE>SecondaryIndex.subIndex(SK)</CODE></A> returns values ordered by primary key.</p> <p><em>WARNING:</em> Cursors must always be closed to prevent resource leaks which could lead to the index becoming unusable or cause an <code>OutOfMemoryError</code>. To ensure that a cursor is closed in the face of exceptions, call <A HREF="../../../com/sleepycat/persist/EntityCursor.html#close()"><CODE>close()</CODE></A> in a finally block. For example, the following code traverses all Employee entities and closes the cursor whether or not an exception occurs:</p> <pre class="code"> @Entity class Employee { @PrimaryKey long id; @SecondaryKey(relate=MANY_TO_ONE) String department; String name; private Employee() {} } EntityStore store = ... <code>PrimaryIndex<Long,Employee></code> primaryIndex = store.getPrimaryIndex(Long.class, Employee.class); <code>EntityCursor<Employee></code> cursor = primaryIndex.entities(); try { for (Employee entity = cursor.first(); entity != null; entity = cursor.next()) { // Do something with the entity... } } finally { cursor.close(); }</pre> <h3>Initializing the Cursor Position</h3> <p>When it is opened, a cursor is not initially positioned on any value; in other words, it is uninitialized. Most methods in this interface initialize the cursor position but certain methods, for example, <A HREF="../../../com/sleepycat/persist/EntityCursor.html#current()"><CODE>current()</CODE></A> and <A HREF="../../../com/sleepycat/persist/EntityCursor.html#delete()"><CODE>delete()</CODE></A>, throw <CODE>IllegalStateException</CODE> when called for an uninitialized cursor.</p> <p>Note that the <A HREF="../../../com/sleepycat/persist/EntityCursor.html#next()"><CODE>next()</CODE></A> and <A HREF="../../../com/sleepycat/persist/EntityCursor.html#prev()"><CODE>prev()</CODE></A> methods return the first or last value respectively for an uninitialized cursor. This allows the loop in the example above to be rewritten as follows:</p> <pre class="code"> <code>EntityCursor<Employee></code> cursor = primaryIndex.entities(); try { Employee entity; while ((entity = cursor.next()) != null) { // Do something with the entity... } } finally { cursor.close(); }</pre> <h3>Cursors and Iterators</h3> <p>The <A HREF="../../../com/sleepycat/persist/EntityCursor.html#iterator()"><CODE>iterator()</CODE></A> method can be used to return a standard Java <code>Iterator</code> that returns the same values that the cursor returns. For example:</p> <pre class="code"> <code>EntityCursor<Employee></code> cursor = primaryIndex.entities(); try { <code>Iterator<Employee></code> i = cursor.iterator(); while (i.hasNext()) { Employee entity = i.next(); // Do something with the entity... } } finally { cursor.close(); }</pre> <p>The <CODE>Iterable</CODE> interface is also extended by <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist"><CODE>EntityCursor</CODE></A> to allow using the cursor as the target of a Java "foreach" statement:</p> <pre class="code"> <code>EntityCursor<Employee></code> cursor = primaryIndex.entities(); try { for (Employee entity : cursor) { // Do something with the entity... } } finally { cursor.close(); }</pre> <p>The iterator uses the cursor directly, so any changes to the cursor position impact the iterator and vice versa. The iterator advances the cursor by calling <A HREF="../../../com/sleepycat/persist/EntityCursor.html#next()"><CODE>next()</CODE></A> when <CODE>Iterator.hasNext()</CODE> or <CODE>Iterator.next()</CODE> is called. Because of this interaction, to keep things simple it is best not to mix the use of an <code>EntityCursor</code> <code>Iterator</code> with the use of the <code>EntityCursor</code> traversal methods such as <A HREF="../../../com/sleepycat/persist/EntityCursor.html#next()"><CODE>next()</CODE></A>, for a single <code>EntityCursor</code> object.</p> <h3>Key Ranges</h3> <p>A key range may be specified when opening the cursor, to restrict the key range of the cursor to a subset of the complete range of keys in the index. A <code>fromKey</code> and/or <code>toKey</code> parameter may be specified when calling <A HREF="../../../com/sleepycat/persist/EntityIndex.html#keys(K, boolean, K, boolean)"><CODE>EntityIndex.keys(Object,boolean,Object,boolean)</CODE></A> or <A HREF="../../../com/sleepycat/persist/EntityIndex.html#entities(K, boolean, K, boolean)"><CODE>EntityIndex.entities(Object,boolean,Object,boolean)</CODE></A>. The key arguments may be specified as inclusive or exclusive values.</p> <p>Whenever a cursor with a key range is moved, the key range bounds will be checked, and the cursor will never be positioned outside the range. The <A HREF="../../../com/sleepycat/persist/EntityCursor.html#first()"><CODE>first()</CODE></A> cursor value is the first existing value in the range, and the <A HREF="../../../com/sleepycat/persist/EntityCursor.html#last()"><CODE>last()</CODE></A> cursor value is the last existing value in the range. For example, the following code traverses Employee entities with keys from 100 (inclusive) to 200 (exclusive):</p> <pre class="code"> <code>EntityCursor<Employee></code> cursor = primaryIndex.entities(100, true, 200, false); try { for (Employee entity : cursor) { // Do something with the entity... } } finally { cursor.close(); }</pre> <h3>Duplicate Keys</h3> <p>When using a cursor for a <A HREF="../../../com/sleepycat/persist/SecondaryIndex.html" title="class in com.sleepycat.persist"><CODE>SecondaryIndex</CODE></A>, the keys in the index may be non-unique (duplicates) if <A HREF="../../../com/sleepycat/persist/model/SecondaryKey.html#relate()"><CODE>SecondaryKey.relate()</CODE></A> is <A HREF="../../../com/sleepycat/persist/model/Relationship.html#MANY_TO_ONE"><CODE>MANY_TO_ONE</CODE></A> or <A HREF="../../../com/sleepycat/persist/model/Relationship.html#MANY_TO_MANY"><CODE>MANY_TO_MANY</CODE></A>. For example, a <code>MANY_TO_ONE</code> <code>Employee.department</code> secondary key is non-unique because there are multiple Employee entities with the same department key value. The <A HREF="../../../com/sleepycat/persist/EntityCursor.html#nextDup()"><CODE>nextDup()</CODE></A>, <A HREF="../../../com/sleepycat/persist/EntityCursor.html#prevDup()"><CODE>prevDup()</CODE></A>, <A HREF="../../../com/sleepycat/persist/EntityCursor.html#nextNoDup()"><CODE>nextNoDup()</CODE></A> and <A HREF="../../../com/sleepycat/persist/EntityCursor.html#prevNoDup()"><CODE>prevNoDup()</CODE></A> methods may be used to control how non-unique keys are returned by the cursor.</p> <p><A HREF="../../../com/sleepycat/persist/EntityCursor.html#nextDup()"><CODE>nextDup()</CODE></A> and <A HREF="../../../com/sleepycat/persist/EntityCursor.html#prevDup()"><CODE>prevDup()</CODE></A> return the next or previous value only if it has the same key as the current value, and null is returned when a different key is encountered. For example, these methods can be used to return all employees in a given department.</p> <p><A HREF="../../../com/sleepycat/persist/EntityCursor.html#nextNoDup()"><CODE>nextNoDup()</CODE></A> and <A HREF="../../../com/sleepycat/persist/EntityCursor.html#prevNoDup()"><CODE>prevNoDup()</CODE></A> return the next or previous value with a unique key, skipping over values that have the same key. For example, these methods can be used to return the first employee in each department.</p> <p>For example, the following code will find the first employee in each department with <A HREF="../../../com/sleepycat/persist/EntityCursor.html#nextNoDup()"><CODE>nextNoDup()</CODE></A> until it finds a department name that matches a particular regular expression. For each matching department it will find all employees in that department using <A HREF="../../../com/sleepycat/persist/EntityCursor.html#nextDup()"><CODE>nextDup()</CODE></A>.</p> <pre class="code"> <code>SecondaryIndex<String,Long,Employee></code> secondaryIndex = store.getSecondaryIndex(primaryIndex, String.class, "department"); String regex = ...; <code>EntityCursor<Employee></code> cursor = secondaryIndex.entities(); try { for (Employee entity = cursor.first(); entity != null; entity = cursor.nextNoDup()) { if (entity.department.matches(regex)) { while (entity != null) { // Do something with the matching entities... entity = cursor.nextDup(); } } } } finally { cursor.close(); }</pre> <h3>Updating and Deleting Entities with a Cursor</h3> <p>The <A HREF="../../../com/sleepycat/persist/EntityCursor.html#update(V)"><CODE>update(V)</CODE></A> and <A HREF="../../../com/sleepycat/persist/EntityCursor.html#delete()"><CODE>delete()</CODE></A> methods operate on the entity at the current cursor position. Cursors on any type of index may be used to delete entities. For example, the following code deletes all employees in departments which have names that match a particular regular expression:</p> <pre class="code"> <code>SecondaryIndex<String,Long,Employee></code> secondaryIndex = store.getSecondaryIndex(primaryIndex, String.class, "department"); String regex = ...; <code>EntityCursor<Employee></code> cursor = secondaryIndex.entities(); try { for (Employee entity = cursor.first(); entity != null; entity = cursor.nextNoDup()) { if (entity.department.matches(regex)) { while (entity != null) { cursor.delete(); entity = cursor.nextDup(); } } } } finally { cursor.close(); }</pre> <p>Note that the cursor can be moved to the next (or previous) value after deleting the entity at the current position. This is an important property of cursors, since without it you would not be able to easily delete while processing multiple values with a cursor. A cursor positioned on a deleted entity is in a special state. In this state, <A HREF="../../../com/sleepycat/persist/EntityCursor.html#current()"><CODE>current()</CODE></A> will return null, <A HREF="../../../com/sleepycat/persist/EntityCursor.html#delete()"><CODE>delete()</CODE></A> will return false, and <A HREF="../../../com/sleepycat/persist/EntityCursor.html#update(V)"><CODE>update(V)</CODE></A> will return false.</p> <p>The <A HREF="../../../com/sleepycat/persist/EntityCursor.html#update(V)"><CODE>update(V)</CODE></A> method is supported only if the value type is an entity class (not a key class) and the underlying index is a <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="class in com.sleepycat.persist"><CODE>PrimaryIndex</CODE></A>; in other words, for a cursor returned by one of the <CODE>BasicIndex.entities()</CODE> methods. For example, the following code changes all employee names to uppercase:</p> <pre class="code"> <code>EntityCursor<Employee></code> cursor = primaryIndex.entities(); try { for (Employee entity = cursor.first(); entity != null; entity = cursor.next()) { entity.name = entity.name.toUpperCase(); cursor.update(entity); } } finally { cursor.close(); }</pre> <P> <P> <HR> <P> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </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/persist/EntityCursor.html#close()">close</A></B>()</CODE> <BR> Closes the cursor.</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/persist/EntityCursor.html#count()">count</A></B>()</CODE> <BR> Returns the number of values (duplicates) for the key at the cursor position, or returns zero if all values for the key have been deleted, Returns one or zero if the underlying index has unique keys.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#current()">current</A></B>()</CODE> <BR> Returns the value at the cursor position, or null if the value at the cursor position has been deleted.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#current(com.sleepycat.db.LockMode)">current</A></B>(<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode)</CODE> <BR> Returns the value at the cursor position, or null if the value at the cursor position has been deleted.</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/persist/EntityCursor.html#delete()">delete</A></B>()</CODE> <BR> Deletes the entity at the cursor position.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#dup()">dup</A></B>()</CODE> <BR> Duplicates the cursor at the cursor position.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#first()">first</A></B>()</CODE> <BR> Moves the cursor to the first value and returns it, or returns null if the cursor range is empty.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#first(com.sleepycat.db.LockMode)">first</A></B>(<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode)</CODE> <BR> Moves the cursor to the first value and returns it, or returns null if the cursor range is empty.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.util.Iterator<<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#iterator()">iterator</A></B>()</CODE> <BR> Returns an iterator over the key range, starting with the value following the current position or at the first value if the cursor is uninitialized.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.util.Iterator<<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#iterator(com.sleepycat.db.LockMode)">iterator</A></B>(<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode)</CODE> <BR> Returns an iterator over the key range, starting with the value following the current position or at the first value if the cursor is uninitialized.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#last()">last</A></B>()</CODE> <BR> Moves the cursor to the last value and returns it, or returns null if the cursor range is empty.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#last(com.sleepycat.db.LockMode)">last</A></B>(<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode)</CODE> <BR> Moves the cursor to the last value and returns it, or returns null if the cursor range is empty.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#next()">next</A></B>()</CODE> <BR> Moves the cursor to the next value and returns it, or returns null if there are no more values in the cursor range.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#next(com.sleepycat.db.LockMode)">next</A></B>(<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode)</CODE> <BR> Moves the cursor to the next value and returns it, or returns null if there are no more values in the cursor range.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#nextDup()">nextDup</A></B>()</CODE> <BR> Moves the cursor to the next value with the same key (duplicate) and returns it, or returns null if no more values are present for the key at the current position.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#nextDup(com.sleepycat.db.LockMode)">nextDup</A></B>(<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode)</CODE> <BR> Moves the cursor to the next value with the same key (duplicate) and returns it, or returns null if no more values are present for the key at the current position.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#nextNoDup()">nextNoDup</A></B>()</CODE> <BR> Moves the cursor to the next value with a different key and returns it, or returns null if there are no more unique keys in the cursor range.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#nextNoDup(com.sleepycat.db.LockMode)">nextNoDup</A></B>(<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode)</CODE> <BR> Moves the cursor to the next value with a different key and returns it, or returns null if there are no more unique keys in the cursor range.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#prev()">prev</A></B>()</CODE> <BR> Moves the cursor to the previous value and returns it, or returns null if there are no preceding values in the cursor range.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#prev(com.sleepycat.db.LockMode)">prev</A></B>(<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode)</CODE> <BR> Moves the cursor to the previous value and returns it, or returns null if there are no preceding values in the cursor range.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#prevDup()">prevDup</A></B>()</CODE> <BR> Moves the cursor to the previous value with the same key (duplicate) and returns it, or returns null if no preceding values are present for the key at the current position.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#prevDup(com.sleepycat.db.LockMode)">prevDup</A></B>(<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode)</CODE> <BR> Moves the cursor to the previous value with the same key (duplicate) and returns it, or returns null if no preceding values are present for the key at the current position.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#prevNoDup()">prevNoDup</A></B>()</CODE> <BR> Moves the cursor to the preceding value with a different key and returns it, or returns null if there are no preceding unique keys in the cursor range.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#prevNoDup(com.sleepycat.db.LockMode)">prevNoDup</A></B>(<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode)</CODE> <BR> Moves the cursor to the preceding value with a different key and returns it, or returns null if there are no preceding unique keys in the cursor range.</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/persist/EntityCursor.html#update(V)">update</A></B>(<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> entity)</CODE> <BR> Replaces the entity at the cursor position with the given entity.</TD> </TR> </TABLE> <P> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="first()"><!-- --></A><H3> first</H3> <PRE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>first</B>() throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Moves the cursor to the first value and returns it, or returns null if the cursor range is empty. <p><A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the first value, or null if the cursor range is empty. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="first(com.sleepycat.db.LockMode)"><!-- --></A><H3> first</H3> <PRE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>first</B>(<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Moves the cursor to the first value and returns it, or returns null if the cursor range is empty. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>lockMode</CODE> - the lock mode to use for this operation, or null to use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. <DT><B>Returns:</B><DD>the first value, or null if the cursor range is empty. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="last()"><!-- --></A><H3> last</H3> <PRE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>last</B>() throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Moves the cursor to the last value and returns it, or returns null if the cursor range is empty. <p><A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the last value, or null if the cursor range is empty. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="last(com.sleepycat.db.LockMode)"><!-- --></A><H3> last</H3> <PRE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>last</B>(<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Moves the cursor to the last value and returns it, or returns null if the cursor range is empty. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>lockMode</CODE> - the lock mode to use for this operation, or null to use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. <DT><B>Returns:</B><DD>the last value, or null if the cursor range is empty. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="next()"><!-- --></A><H3> next</H3> <PRE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>next</B>() throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Moves the cursor to the next value and returns it, or returns null if there are no more values in the cursor range. If the cursor is uninitialized, this method is equivalent to <A HREF="../../../com/sleepycat/persist/EntityCursor.html#first()"><CODE>first()</CODE></A>. <p><A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/sleepycat/persist/ForwardCursor.html#next()">next</A></CODE> in interface <CODE><A HREF="../../../com/sleepycat/persist/ForwardCursor.html" title="interface in com.sleepycat.persist">ForwardCursor</A><<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the next value, or null if there are no more values in the cursor range. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="next(com.sleepycat.db.LockMode)"><!-- --></A><H3> next</H3> <PRE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>next</B>(<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Moves the cursor to the next value and returns it, or returns null if there are no more values in the cursor range. If the cursor is uninitialized, this method is equivalent to <A HREF="../../../com/sleepycat/persist/EntityCursor.html#first()"><CODE>first()</CODE></A>. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/sleepycat/persist/ForwardCursor.html#next(com.sleepycat.db.LockMode)">next</A></CODE> in interface <CODE><A HREF="../../../com/sleepycat/persist/ForwardCursor.html" title="interface in com.sleepycat.persist">ForwardCursor</A><<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>lockMode</CODE> - the lock mode to use for this operation, or null to use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. <DT><B>Returns:</B><DD>the next value, or null if there are no more values in the cursor range. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="nextDup()"><!-- --></A><H3> nextDup</H3> <PRE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>nextDup</B>() throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Moves the cursor to the next value with the same key (duplicate) and returns it, or returns null if no more values are present for the key at the current position. <p><A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the next value with the same key, or null if no more values are present for the key at the current position. <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalStateException</CODE> - if the cursor is uninitialized. <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="nextDup(com.sleepycat.db.LockMode)"><!-- --></A><H3> nextDup</H3> <PRE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>nextDup</B>(<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Moves the cursor to the next value with the same key (duplicate) and returns it, or returns null if no more values are present for the key at the current position. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>lockMode</CODE> - the lock mode to use for this operation, or null to use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. <DT><B>Returns:</B><DD>the next value with the same key, or null if no more values are present for the key at the current position. <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalStateException</CODE> - if the cursor is uninitialized. <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="nextNoDup()"><!-- --></A><H3> nextNoDup</H3> <PRE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>nextNoDup</B>() throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Moves the cursor to the next value with a different key and returns it, or returns null if there are no more unique keys in the cursor range. If the cursor is uninitialized, this method is equivalent to <A HREF="../../../com/sleepycat/persist/EntityCursor.html#first()"><CODE>first()</CODE></A>. <p><A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the next value with a different key, or null if there are no more unique keys in the cursor range. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="nextNoDup(com.sleepycat.db.LockMode)"><!-- --></A><H3> nextNoDup</H3> <PRE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>nextNoDup</B>(<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Moves the cursor to the next value with a different key and returns it, or returns null if there are no more unique keys in the cursor range. If the cursor is uninitialized, this method is equivalent to <A HREF="../../../com/sleepycat/persist/EntityCursor.html#first()"><CODE>first()</CODE></A>. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>lockMode</CODE> - the lock mode to use for this operation, or null to use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. <DT><B>Returns:</B><DD>the next value with a different key, or null if there are no more unique keys in the cursor range. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="prev()"><!-- --></A><H3> prev</H3> <PRE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>prev</B>() throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Moves the cursor to the previous value and returns it, or returns null if there are no preceding values in the cursor range. If the cursor is uninitialized, this method is equivalent to <A HREF="../../../com/sleepycat/persist/EntityCursor.html#last()"><CODE>last()</CODE></A>. <p><A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the previous value, or null if there are no preceding values in the cursor range. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="prev(com.sleepycat.db.LockMode)"><!-- --></A><H3> prev</H3> <PRE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>prev</B>(<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Moves the cursor to the previous value and returns it, or returns null if there are no preceding values in the cursor range. If the cursor is uninitialized, this method is equivalent to <A HREF="../../../com/sleepycat/persist/EntityCursor.html#last()"><CODE>last()</CODE></A>. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>lockMode</CODE> - the lock mode to use for this operation, or null to use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. <DT><B>Returns:</B><DD>the previous value, or null if there are no preceding values in the cursor range. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="prevDup()"><!-- --></A><H3> prevDup</H3> <PRE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>prevDup</B>() throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Moves the cursor to the previous value with the same key (duplicate) and returns it, or returns null if no preceding values are present for the key at the current position. <p><A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the previous value with the same key, or null if no preceding values are present for the key at the current position. <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalStateException</CODE> - if the cursor is uninitialized. <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="prevDup(com.sleepycat.db.LockMode)"><!-- --></A><H3> prevDup</H3> <PRE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>prevDup</B>(<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Moves the cursor to the previous value with the same key (duplicate) and returns it, or returns null if no preceding values are present for the key at the current position. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>lockMode</CODE> - the lock mode to use for this operation, or null to use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. <DT><B>Returns:</B><DD>the previous value with the same key, or null if no preceding values are present for the key at the current position. <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalStateException</CODE> - if the cursor is uninitialized. <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="prevNoDup()"><!-- --></A><H3> prevNoDup</H3> <PRE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>prevNoDup</B>() throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Moves the cursor to the preceding value with a different key and returns it, or returns null if there are no preceding unique keys in the cursor range. If the cursor is uninitialized, this method is equivalent to <A HREF="../../../com/sleepycat/persist/EntityCursor.html#last()"><CODE>last()</CODE></A>. <p><A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the previous value with a different key, or null if there are no preceding unique keys in the cursor range. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="prevNoDup(com.sleepycat.db.LockMode)"><!-- --></A><H3> prevNoDup</H3> <PRE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>prevNoDup</B>(<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Moves the cursor to the preceding value with a different key and returns it, or returns null if there are no preceding unique keys in the cursor range. If the cursor is uninitialized, this method is equivalent to <A HREF="../../../com/sleepycat/persist/EntityCursor.html#last()"><CODE>last()</CODE></A>. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>lockMode</CODE> - the lock mode to use for this operation, or null to use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. <DT><B>Returns:</B><DD>the previous value with a different key, or null if there are no preceding unique keys in the cursor range. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="current()"><!-- --></A><H3> current</H3> <PRE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>current</B>() throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Returns the value at the cursor position, or null if the value at the cursor position has been deleted. <p><A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the value at the cursor position, or null if it has been deleted. <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalStateException</CODE> - if the cursor is uninitialized. <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="current(com.sleepycat.db.LockMode)"><!-- --></A><H3> current</H3> <PRE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>current</B>(<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Returns the value at the cursor position, or null if the value at the cursor position has been deleted. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>lockMode</CODE> - the lock mode to use for this operation, or null to use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. <DT><B>Returns:</B><DD>the value at the cursor position, or null if it has been deleted. <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalStateException</CODE> - if the cursor is uninitialized. <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="count()"><!-- --></A><H3> count</H3> <PRE> int <B>count</B>() throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Returns the number of values (duplicates) for the key at the cursor position, or returns zero if all values for the key have been deleted, Returns one or zero if the underlying index has unique keys. <p><A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the number of duplicates, or zero if all values for the current key have been deleted. <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalStateException</CODE> - if the cursor is uninitialized. <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="iterator()"><!-- --></A><H3> iterator</H3> <PRE> java.util.Iterator<<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>> <B>iterator</B>()</PRE> <DL> <DD>Returns an iterator over the key range, starting with the value following the current position or at the first value if the cursor is uninitialized. <p><A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/sleepycat/persist/ForwardCursor.html#iterator()">iterator</A></CODE> in interface <CODE><A HREF="../../../com/sleepycat/persist/ForwardCursor.html" title="interface in com.sleepycat.persist">ForwardCursor</A><<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>></CODE><DT><B>Specified by:</B><DD><CODE>iterator</CODE> in interface <CODE>java.lang.Iterable<<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the iterator.</DL> </DD> </DL> <HR> <A NAME="iterator(com.sleepycat.db.LockMode)"><!-- --></A><H3> iterator</H3> <PRE> java.util.Iterator<<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>> <B>iterator</B>(<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode)</PRE> <DL> <DD>Returns an iterator over the key range, starting with the value following the current position or at the first value if the cursor is uninitialized. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/sleepycat/persist/ForwardCursor.html#iterator(com.sleepycat.db.LockMode)">iterator</A></CODE> in interface <CODE><A HREF="../../../com/sleepycat/persist/ForwardCursor.html" title="interface in com.sleepycat.persist">ForwardCursor</A><<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>lockMode</CODE> - the lock mode to use for all operations performed using the iterator, or null to use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. <DT><B>Returns:</B><DD>the iterator.</DL> </DD> </DL> <HR> <A NAME="update(java.lang.Object)"><!-- --></A><A NAME="update(V)"><!-- --></A><H3> update</H3> <PRE> boolean <B>update</B>(<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> entity) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Replaces the entity at the cursor position with the given entity. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>entity</CODE> - the entity to replace the entity at the current position. <DT><B>Returns:</B><DD>true if successful or false if the entity at the current position was previously deleted. <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalStateException</CODE> - if the cursor is uninitialized. <DD><CODE>java.lang.UnsupportedOperationException</CODE> - if the index is read only or if the value type is not an entity type. <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="delete()"><!-- --></A><H3> delete</H3> <PRE> boolean <B>delete</B>() throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Deletes the entity at the cursor position. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>true if successful or false if the entity at the current position has been deleted. <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalStateException</CODE> - if the cursor is uninitialized. <DD><CODE>java.lang.UnsupportedOperationException</CODE> - if the index is read only. <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="dup()"><!-- --></A><H3> dup</H3> <PRE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>> <B>dup</B>() throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Duplicates the cursor at the cursor position. The returned cursor will be initially positioned at the same position as this current cursor, and will inherit this cursor's <A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db"><CODE>Transaction</CODE></A> and <A HREF="../../../com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db"><CODE>CursorConfig</CODE></A>. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the duplicated cursor. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="close()"><!-- --></A><H3> close</H3> <PRE> void <B>close</B>() throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Closes the cursor. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/sleepycat/persist/ForwardCursor.html#close()">close</A></CODE> in interface <CODE><A HREF="../../../com/sleepycat/persist/ForwardCursor.html" title="interface in com.sleepycat.persist">ForwardCursor</A><<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>></CODE></DL> </DD> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></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=2 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="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> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../com/sleepycat/persist/DatabaseNamer.html" title="interface in com.sleepycat.persist"><B>PREV CLASS</B></A> <A HREF="../../../com/sleepycat/persist/EntityIndex.html" title="interface in com.sleepycat.persist"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?com/sleepycat/persist/EntityCursor.html" target="_top"><B>FRAMES</B></A> <A HREF="EntityCursor.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> </BODY> </HTML>