| 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| 2 |
|
| 3 |
<HTML> |
| 4 |
<HEAD> |
| 5 |
|
| 6 |
<TITLE> |
| 7 |
EntityCursor (Oracle - Berkeley DB Java API) |
| 8 |
</TITLE> |
| 9 |
|
| 10 |
<META NAME="date" CONTENT="2013-09-09"> |
| 11 |
|
| 12 |
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../style.css" TITLE="Style"> |
| 13 |
|
| 14 |
<SCRIPT type="text/javascript"> |
| 15 |
function windowTitle() |
| 16 |
{ |
| 17 |
if (location.href.indexOf('is-external=true') == -1) { |
| 18 |
parent.document.title="EntityCursor (Oracle - Berkeley DB Java API)"; |
| 19 |
} |
| 20 |
} |
| 21 |
</SCRIPT> |
| 22 |
<NOSCRIPT> |
| 23 |
</NOSCRIPT> |
| 24 |
|
| 25 |
</HEAD> |
| 26 |
|
| 27 |
<BODY BGCOLOR="white" onload="windowTitle();"> |
| 28 |
<HR> |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
<A NAME="navbar_top"></A> |
| 33 |
<A HREF="#skip-navbar_top" title="Skip navigation links"></A> |
| 34 |
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| 35 |
<TR> |
| 36 |
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| 37 |
<A NAME="navbar_top_firstrow"></A> |
| 38 |
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| 39 |
<TR ALIGN="center" VALIGN="top"> |
| 40 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| 41 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| 42 |
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| 43 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/EntityCursor.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| 44 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| 45 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| 46 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| 47 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| 48 |
</TR> |
| 49 |
</TABLE> |
| 50 |
</TD> |
| 51 |
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| 52 |
<b>Berkeley DB</b><br><font size="-1"> version 5.3.28</font></EM> |
| 53 |
</TD> |
| 54 |
</TR> |
| 55 |
|
| 56 |
<TR> |
| 57 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 58 |
<A HREF="../../../com/sleepycat/persist/DatabaseNamer.html" title="interface in com.sleepycat.persist"><B>PREV CLASS</B></A> |
| 59 |
<A HREF="../../../com/sleepycat/persist/EntityIndex.html" title="interface in com.sleepycat.persist"><B>NEXT CLASS</B></A></FONT></TD> |
| 60 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 61 |
<A HREF="../../../index.html?com/sleepycat/persist/EntityCursor.html" target="_top"><B>FRAMES</B></A> |
| 62 |
<A HREF="EntityCursor.html" target="_top"><B>NO FRAMES</B></A> |
| 63 |
<SCRIPT type="text/javascript"> |
| 64 |
<!-- |
| 65 |
if(window==top) { |
| 66 |
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
| 67 |
} |
| 68 |
//--> |
| 69 |
</SCRIPT> |
| 70 |
<NOSCRIPT> |
| 71 |
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> |
| 72 |
</NOSCRIPT> |
| 73 |
|
| 74 |
|
| 75 |
</FONT></TD> |
| 76 |
</TR> |
| 77 |
<TR> |
| 78 |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| 79 |
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| 80 |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| 81 |
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| 82 |
</TR> |
| 83 |
</TABLE> |
| 84 |
<A NAME="skip-navbar_top"></A> |
| 85 |
|
| 86 |
|
| 87 |
<HR> |
| 88 |
|
| 89 |
<H2> |
| 90 |
<FONT SIZE="-1"> |
| 91 |
com.sleepycat.persist</FONT> |
| 92 |
<BR> |
| 93 |
Interface EntityCursor<V></H2> |
| 94 |
<DL> |
| 95 |
<DT><B>All Superinterfaces:</B> <DD><A HREF="../../../com/sleepycat/persist/ForwardCursor.html" title="interface in com.sleepycat.persist">ForwardCursor</A><V>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A><V></DD> |
| 96 |
</DL> |
| 97 |
<HR> |
| 98 |
<DL> |
| 99 |
<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> |
| 100 |
</PRE> |
| 101 |
|
| 102 |
<P> |
| 103 |
Traverses entity values or key values and allows deleting or updating the |
| 104 |
entity at the current cursor position. The value type (V) is either an |
| 105 |
entity class or a key class, depending on how the cursor was opened. |
| 106 |
|
| 107 |
<p><code>EntityCursor</code> objects are <em>not</em> thread-safe. Cursors |
| 108 |
should be opened, used and closed by a single thread.</p> |
| 109 |
|
| 110 |
<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 |
| 111 |
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 |
| 112 |
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> |
| 113 |
methods.</p> |
| 114 |
|
| 115 |
<p>Values are always returned by a cursor in key order, where the key is |
| 116 |
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 |
| 117 |
<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 |
| 118 |
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 |
| 119 |
values ordered by primary key.</p> |
| 120 |
|
| 121 |
<p><em>WARNING:</em> Cursors must always be closed to prevent resource leaks |
| 122 |
which could lead to the index becoming unusable or cause an |
| 123 |
<code>OutOfMemoryError</code>. To ensure that a cursor is closed in the |
| 124 |
face of exceptions, call <A HREF="../../../com/sleepycat/persist/EntityCursor.html#close()"><CODE>close()</CODE></A> in a finally block. For example, |
| 125 |
the following code traverses all Employee entities and closes the cursor |
| 126 |
whether or not an exception occurs:</p> |
| 127 |
|
| 128 |
<pre class="code"> |
| 129 |
@Entity |
| 130 |
class Employee { |
| 131 |
|
| 132 |
@PrimaryKey |
| 133 |
long id; |
| 134 |
|
| 135 |
@SecondaryKey(relate=MANY_TO_ONE) |
| 136 |
String department; |
| 137 |
|
| 138 |
String name; |
| 139 |
|
| 140 |
private Employee() {} |
| 141 |
} |
| 142 |
|
| 143 |
EntityStore store = ... |
| 144 |
|
| 145 |
<code>PrimaryIndex<Long, Employee></code> primaryIndex = |
| 146 |
store.getPrimaryIndex(Long.class, Employee.class); |
| 147 |
|
| 148 |
<code>EntityCursor<Employee></code> cursor = primaryIndex.entities(); |
| 149 |
try { |
| 150 |
for (Employee entity = cursor.first(); |
| 151 |
entity != null; |
| 152 |
entity = cursor.next()) { |
| 153 |
// Do something with the entity... |
| 154 |
} |
| 155 |
} finally { |
| 156 |
cursor.close(); |
| 157 |
}</pre> |
| 158 |
|
| 159 |
<h3>Initializing the Cursor Position</h3> |
| 160 |
|
| 161 |
<p>When it is opened, a cursor is not initially positioned on any value; in |
| 162 |
other words, it is uninitialized. Most methods in this interface initialize |
| 163 |
the cursor position but certain methods, for example, <A HREF="../../../com/sleepycat/persist/EntityCursor.html#current()"><CODE>current()</CODE></A> and |
| 164 |
<A HREF="../../../com/sleepycat/persist/EntityCursor.html#delete()"><CODE>delete()</CODE></A>, throw <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang"><CODE>IllegalStateException</CODE></A> when called for an |
| 165 |
uninitialized cursor.</p> |
| 166 |
|
| 167 |
<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 |
| 168 |
last value respectively for an uninitialized cursor. This allows the loop |
| 169 |
in the example above to be rewritten as follows:</p> |
| 170 |
|
| 171 |
<pre class="code"> |
| 172 |
<code>EntityCursor<Employee></code> cursor = primaryIndex.entities(); |
| 173 |
try { |
| 174 |
Employee entity; |
| 175 |
while ((entity = cursor.next()) != null) { |
| 176 |
// Do something with the entity... |
| 177 |
} |
| 178 |
} finally { |
| 179 |
cursor.close(); |
| 180 |
}</pre> |
| 181 |
|
| 182 |
<h3>Cursors and Iterators</h3> |
| 183 |
|
| 184 |
<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 |
| 185 |
example:</p> |
| 186 |
|
| 187 |
<pre class="code"> |
| 188 |
<code>EntityCursor<Employee></code> cursor = primaryIndex.entities(); |
| 189 |
try { |
| 190 |
<code>Iterator<Employee></code> i = cursor.iterator(); |
| 191 |
while (i.hasNext()) { |
| 192 |
Employee entity = i.next(); |
| 193 |
// Do something with the entity... |
| 194 |
} |
| 195 |
} finally { |
| 196 |
cursor.close(); |
| 197 |
}</pre> |
| 198 |
|
| 199 |
<p>The <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang"><CODE>Iterable</CODE></A> interface is also extended by <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist"><CODE>EntityCursor</CODE></A> |
| 200 |
to allow using the cursor as the target of a Java "foreach" statement:</p> |
| 201 |
|
| 202 |
<pre class="code"> |
| 203 |
<code>EntityCursor<Employee></code> cursor = primaryIndex.entities(); |
| 204 |
try { |
| 205 |
for (Employee entity : cursor) { |
| 206 |
// Do something with the entity... |
| 207 |
} |
| 208 |
} finally { |
| 209 |
cursor.close(); |
| 210 |
}</pre> |
| 211 |
|
| 212 |
<p>The iterator uses the cursor directly, so any changes to the cursor |
| 213 |
position impact the iterator and vice versa. The iterator advances the |
| 214 |
cursor by calling <A HREF="../../../com/sleepycat/persist/EntityCursor.html#next()"><CODE>next()</CODE></A> when <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Iterator.html?is-external=true#hasNext()" title="class or interface in java.util"><CODE>Iterator.hasNext()</CODE></A> or <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Iterator.html?is-external=true#next()" title="class or interface in java.util"><CODE>Iterator.next()</CODE></A> is called. Because of this interaction, to keep things |
| 215 |
simple it is best not to mix the use of an <code>EntityCursor</code> |
| 216 |
<code>Iterator</code> with the use of the <code>EntityCursor</code> traversal methods |
| 217 |
such as <A HREF="../../../com/sleepycat/persist/EntityCursor.html#next()"><CODE>next()</CODE></A>, for a single <code>EntityCursor</code> object.</p> |
| 218 |
|
| 219 |
<h3>Key Ranges</h3> |
| 220 |
|
| 221 |
<p>A key range may be specified when opening the cursor, to restrict the |
| 222 |
key range of the cursor to a subset of the complete range of keys in the |
| 223 |
index. A <code>fromKey</code> and/or <code>toKey</code> parameter may be specified |
| 224 |
when calling <A HREF="../../../com/sleepycat/persist/EntityIndex.html#keys(K, boolean, K, boolean)"><CODE>EntityIndex.keys(Object,boolean,Object,boolean)</CODE></A> or |
| 225 |
<A HREF="../../../com/sleepycat/persist/EntityIndex.html#entities(K, boolean, K, boolean)"><CODE>EntityIndex.entities(Object,boolean,Object,boolean)</CODE></A>. The key |
| 226 |
arguments may be specified as inclusive or exclusive values.</p> |
| 227 |
|
| 228 |
<p>Whenever a cursor with a key range is moved, the key range bounds will be |
| 229 |
checked, and the cursor will never be positioned outside the range. The |
| 230 |
<A HREF="../../../com/sleepycat/persist/EntityCursor.html#first()"><CODE>first()</CODE></A> cursor value is the first existing value in the range, and |
| 231 |
the <A HREF="../../../com/sleepycat/persist/EntityCursor.html#last()"><CODE>last()</CODE></A> cursor value is the last existing value in the range. For |
| 232 |
example, the following code traverses Employee entities with keys from 100 |
| 233 |
(inclusive) to 200 (exclusive):</p> |
| 234 |
|
| 235 |
<pre class="code"> |
| 236 |
<code>EntityCursor<Employee></code> cursor = primaryIndex.entities(100, true, 200, false); |
| 237 |
try { |
| 238 |
for (Employee entity : cursor) { |
| 239 |
// Do something with the entity... |
| 240 |
} |
| 241 |
} finally { |
| 242 |
cursor.close(); |
| 243 |
}</pre> |
| 244 |
|
| 245 |
<h3>Duplicate Keys</h3> |
| 246 |
|
| 247 |
<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 |
| 248 |
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 |
| 249 |
Employee entities with the same department key value. The <A HREF="../../../com/sleepycat/persist/EntityCursor.html#nextDup()"><CODE>nextDup()</CODE></A>, |
| 250 |
<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 |
| 251 |
used to control how non-unique keys are returned by the cursor.</p> |
| 252 |
|
| 253 |
<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 |
| 254 |
only if it has the same key as the current value, and null is returned when |
| 255 |
a different key is encountered. For example, these methods can be used to |
| 256 |
return all employees in a given department.</p> |
| 257 |
|
| 258 |
<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 |
| 259 |
value with a unique key, skipping over values that have the same key. For |
| 260 |
example, these methods can be used to return the first employee in each |
| 261 |
department.</p> |
| 262 |
|
| 263 |
<p>For example, the following code will find the first employee in each |
| 264 |
department with <A HREF="../../../com/sleepycat/persist/EntityCursor.html#nextNoDup()"><CODE>nextNoDup()</CODE></A> until it finds a department name that |
| 265 |
matches a particular regular expression. For each matching department it |
| 266 |
will find all employees in that department using <A HREF="../../../com/sleepycat/persist/EntityCursor.html#nextDup()"><CODE>nextDup()</CODE></A>.</p> |
| 267 |
|
| 268 |
<pre class="code"> |
| 269 |
<code>SecondaryIndex<String, Long, Employee></code> secondaryIndex = |
| 270 |
store.getSecondaryIndex(primaryIndex, String.class, "department"); |
| 271 |
|
| 272 |
String regex = ...; |
| 273 |
<code>EntityCursor<Employee></code> cursor = secondaryIndex.entities(); |
| 274 |
try { |
| 275 |
for (Employee entity = cursor.first(); |
| 276 |
entity != null; |
| 277 |
entity = cursor.nextNoDup()) { |
| 278 |
if (entity.department.matches(regex)) { |
| 279 |
while (entity != null) { |
| 280 |
// Do something with the matching entities... |
| 281 |
entity = cursor.nextDup(); |
| 282 |
} |
| 283 |
} |
| 284 |
} |
| 285 |
} finally { |
| 286 |
cursor.close(); |
| 287 |
}</pre> |
| 288 |
|
| 289 |
<h3>Updating and Deleting Entities with a Cursor</h3> |
| 290 |
|
| 291 |
<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 |
| 292 |
the current cursor position. Cursors on any type of index may be used to |
| 293 |
delete entities. For example, the following code deletes all employees in |
| 294 |
departments which have names that match a particular regular expression:</p> |
| 295 |
|
| 296 |
<pre class="code"> |
| 297 |
<code>SecondaryIndex<String, Long, Employee></code> secondaryIndex = |
| 298 |
store.getSecondaryIndex(primaryIndex, String.class, "department"); |
| 299 |
|
| 300 |
String regex = ...; |
| 301 |
<code>EntityCursor<Employee></code> cursor = secondaryIndex.entities(); |
| 302 |
try { |
| 303 |
for (Employee entity = cursor.first(); |
| 304 |
entity != null; |
| 305 |
entity = cursor.nextNoDup()) { |
| 306 |
if (entity.department.matches(regex)) { |
| 307 |
while (entity != null) { |
| 308 |
cursor.delete(); |
| 309 |
entity = cursor.nextDup(); |
| 310 |
} |
| 311 |
} |
| 312 |
} |
| 313 |
} finally { |
| 314 |
cursor.close(); |
| 315 |
}</pre> |
| 316 |
|
| 317 |
<p>Note that the cursor can be moved to the next (or previous) value after |
| 318 |
deleting the entity at the current position. This is an important property |
| 319 |
of cursors, since without it you would not be able to easily delete while |
| 320 |
processing multiple values with a cursor. A cursor positioned on a deleted |
| 321 |
entity is in a special state. In this state, <A HREF="../../../com/sleepycat/persist/EntityCursor.html#current()"><CODE>current()</CODE></A> will return |
| 322 |
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 |
| 323 |
false.</p> |
| 324 |
|
| 325 |
<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 |
| 326 |
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 |
| 327 |
employee names to uppercase:</p> |
| 328 |
|
| 329 |
<pre class="code"> |
| 330 |
<code>EntityCursor<Employee></code> cursor = primaryIndex.entities(); |
| 331 |
try { |
| 332 |
for (Employee entity = cursor.first(); |
| 333 |
entity != null; |
| 334 |
entity = cursor.next()) { |
| 335 |
entity.name = entity.name.toUpperCase(); |
| 336 |
cursor.update(entity); |
| 337 |
} |
| 338 |
} finally { |
| 339 |
cursor.close(); |
| 340 |
}</pre> |
| 341 |
<P> |
| 342 |
|
| 343 |
<P> |
| 344 |
<HR> |
| 345 |
|
| 346 |
<P> |
| 347 |
|
| 348 |
|
| 349 |
|
| 350 |
<A NAME="method_summary"></A> |
| 351 |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| 352 |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| 353 |
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
| 354 |
<B>Method Summary</B></FONT></TH> |
| 355 |
</TR> |
| 356 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 357 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 358 |
<CODE> void</CODE></FONT></TD> |
| 359 |
<TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#close()">close</A></B>()</CODE> |
| 360 |
|
| 361 |
<BR> |
| 362 |
Closes the cursor.</TD> |
| 363 |
</TR> |
| 364 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 365 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 366 |
<CODE> int</CODE></FONT></TD> |
| 367 |
<TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#count()">count</A></B>()</CODE> |
| 368 |
|
| 369 |
<BR> |
| 370 |
Returns the number of values (duplicates) for the key at the cursor |
| 371 |
position, or returns zero if all values for the key have been deleted.</TD> |
| 372 |
</TR> |
| 373 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 374 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 375 |
<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> |
| 376 |
<TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#current()">current</A></B>()</CODE> |
| 377 |
|
| 378 |
<BR> |
| 379 |
Returns the value at the cursor position, or null if the value at the |
| 380 |
cursor position has been deleted.</TD> |
| 381 |
</TR> |
| 382 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 383 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 384 |
<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> |
| 385 |
<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> |
| 386 |
|
| 387 |
<BR> |
| 388 |
Returns the value at the cursor position, or null if the value at the |
| 389 |
cursor position has been deleted.</TD> |
| 390 |
</TR> |
| 391 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 392 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 393 |
<CODE> boolean</CODE></FONT></TD> |
| 394 |
<TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#delete()">delete</A></B>()</CODE> |
| 395 |
|
| 396 |
<BR> |
| 397 |
Deletes the entity at the cursor position.</TD> |
| 398 |
</TR> |
| 399 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 400 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 401 |
<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> |
| 402 |
<TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#dup()">dup</A></B>()</CODE> |
| 403 |
|
| 404 |
<BR> |
| 405 |
Duplicates the cursor at the cursor position.</TD> |
| 406 |
</TR> |
| 407 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 408 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 409 |
<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> |
| 410 |
<TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#first()">first</A></B>()</CODE> |
| 411 |
|
| 412 |
<BR> |
| 413 |
Moves the cursor to the first value and returns it, or returns null if |
| 414 |
the cursor range is empty.</TD> |
| 415 |
</TR> |
| 416 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 417 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 418 |
<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> |
| 419 |
<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> |
| 420 |
|
| 421 |
<BR> |
| 422 |
Moves the cursor to the first value and returns it, or returns null if |
| 423 |
the cursor range is empty.</TD> |
| 424 |
</TR> |
| 425 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 426 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 427 |
<CODE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</A><<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>></CODE></FONT></TD> |
| 428 |
<TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#iterator()">iterator</A></B>()</CODE> |
| 429 |
|
| 430 |
<BR> |
| 431 |
Returns an iterator over the key range, starting with the value |
| 432 |
following the current position or at the first value if the cursor is |
| 433 |
uninitialized.</TD> |
| 434 |
</TR> |
| 435 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 436 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 437 |
<CODE> <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</A><<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>></CODE></FONT></TD> |
| 438 |
<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> |
| 439 |
|
| 440 |
<BR> |
| 441 |
Returns an iterator over the key range, starting with the value |
| 442 |
following the current position or at the first value if the cursor is |
| 443 |
uninitialized.</TD> |
| 444 |
</TR> |
| 445 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 446 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 447 |
<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> |
| 448 |
<TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#last()">last</A></B>()</CODE> |
| 449 |
|
| 450 |
<BR> |
| 451 |
Moves the cursor to the last value and returns it, or returns null if |
| 452 |
the cursor range is empty.</TD> |
| 453 |
</TR> |
| 454 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 455 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 456 |
<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> |
| 457 |
<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> |
| 458 |
|
| 459 |
<BR> |
| 460 |
Moves the cursor to the last value and returns it, or returns null if |
| 461 |
the cursor range is empty.</TD> |
| 462 |
</TR> |
| 463 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 464 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 465 |
<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> |
| 466 |
<TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#next()">next</A></B>()</CODE> |
| 467 |
|
| 468 |
<BR> |
| 469 |
Moves the cursor to the next value and returns it, or returns null |
| 470 |
if there are no more values in the cursor range.</TD> |
| 471 |
</TR> |
| 472 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 473 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 474 |
<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> |
| 475 |
<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> |
| 476 |
|
| 477 |
<BR> |
| 478 |
Moves the cursor to the next value and returns it, or returns null |
| 479 |
if there are no more values in the cursor range.</TD> |
| 480 |
</TR> |
| 481 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 482 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 483 |
<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> |
| 484 |
<TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#nextDup()">nextDup</A></B>()</CODE> |
| 485 |
|
| 486 |
<BR> |
| 487 |
Moves the cursor to the next value with the same key (duplicate) and |
| 488 |
returns it, or returns null if no more values are present for the key at |
| 489 |
the current position.</TD> |
| 490 |
</TR> |
| 491 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 492 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 493 |
<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> |
| 494 |
<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> |
| 495 |
|
| 496 |
<BR> |
| 497 |
Moves the cursor to the next value with the same key (duplicate) and |
| 498 |
returns it, or returns null if no more values are present for the key at |
| 499 |
the current position.</TD> |
| 500 |
</TR> |
| 501 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 502 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 503 |
<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> |
| 504 |
<TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#nextNoDup()">nextNoDup</A></B>()</CODE> |
| 505 |
|
| 506 |
<BR> |
| 507 |
Moves the cursor to the next value with a different key and returns it, |
| 508 |
or returns null if there are no more unique keys in the cursor range.</TD> |
| 509 |
</TR> |
| 510 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 511 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 512 |
<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> |
| 513 |
<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> |
| 514 |
|
| 515 |
<BR> |
| 516 |
Moves the cursor to the next value with a different key and returns it, |
| 517 |
or returns null if there are no more unique keys in the cursor range.</TD> |
| 518 |
</TR> |
| 519 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 520 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 521 |
<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> |
| 522 |
<TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#prev()">prev</A></B>()</CODE> |
| 523 |
|
| 524 |
<BR> |
| 525 |
Moves the cursor to the previous value and returns it, or returns null |
| 526 |
if there are no preceding values in the cursor range.</TD> |
| 527 |
</TR> |
| 528 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 529 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 530 |
<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> |
| 531 |
<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> |
| 532 |
|
| 533 |
<BR> |
| 534 |
Moves the cursor to the previous value and returns it, or returns null |
| 535 |
if there are no preceding values in the cursor range.</TD> |
| 536 |
</TR> |
| 537 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 538 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 539 |
<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> |
| 540 |
<TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#prevDup()">prevDup</A></B>()</CODE> |
| 541 |
|
| 542 |
<BR> |
| 543 |
Moves the cursor to the previous value with the same key (duplicate) and |
| 544 |
returns it, or returns null if no preceding values are present for the |
| 545 |
key at the current position.</TD> |
| 546 |
</TR> |
| 547 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 548 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 549 |
<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> |
| 550 |
<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> |
| 551 |
|
| 552 |
<BR> |
| 553 |
Moves the cursor to the previous value with the same key (duplicate) and |
| 554 |
returns it, or returns null if no preceding values are present for the |
| 555 |
key at the current position.</TD> |
| 556 |
</TR> |
| 557 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 558 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 559 |
<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> |
| 560 |
<TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#prevNoDup()">prevNoDup</A></B>()</CODE> |
| 561 |
|
| 562 |
<BR> |
| 563 |
Moves the cursor to the preceding value with a different key and returns |
| 564 |
it, or returns null if there are no preceding unique keys in the cursor |
| 565 |
range.</TD> |
| 566 |
</TR> |
| 567 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 568 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 569 |
<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A></CODE></FONT></TD> |
| 570 |
<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> |
| 571 |
|
| 572 |
<BR> |
| 573 |
Moves the cursor to the preceding value with a different key and returns |
| 574 |
it, or returns null if there are no preceding unique keys in the cursor |
| 575 |
range.</TD> |
| 576 |
</TR> |
| 577 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 578 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 579 |
<CODE> boolean</CODE></FONT></TD> |
| 580 |
<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> |
| 581 |
|
| 582 |
<BR> |
| 583 |
Replaces the entity at the cursor position with the given entity.</TD> |
| 584 |
</TR> |
| 585 |
</TABLE> |
| 586 |
|
| 587 |
<P> |
| 588 |
|
| 589 |
|
| 590 |
|
| 591 |
<A NAME="method_detail"></A> |
| 592 |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| 593 |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| 594 |
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
| 595 |
<B>Method Detail</B></FONT></TH> |
| 596 |
</TR> |
| 597 |
</TABLE> |
| 598 |
|
| 599 |
<A NAME="first()"></A><H3> |
| 600 |
first</H3> |
| 601 |
<PRE> |
| 602 |
<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>first</B>() |
| 603 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 604 |
<DL> |
| 605 |
<DD>Moves the cursor to the first value and returns it, or returns null if |
| 606 |
the cursor range is empty. |
| 607 |
|
| 608 |
<p><A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> |
| 609 |
<P> |
| 610 |
<DD><DL> |
| 611 |
</DL> |
| 612 |
</DD> |
| 613 |
<DD><DL> |
| 614 |
|
| 615 |
<DT><B>Returns:</B><DD>the first value, or null if the cursor range is empty. |
| 616 |
<DT><B>Throws:</B> |
| 617 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL> |
| 618 |
</DD> |
| 619 |
</DL> |
| 620 |
<HR> |
| 621 |
|
| 622 |
<A NAME="first(com.sleepycat.db.LockMode)"></A><H3> |
| 623 |
first</H3> |
| 624 |
<PRE> |
| 625 |
<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) |
| 626 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 627 |
<DL> |
| 628 |
<DD>Moves the cursor to the first value and returns it, or returns null if |
| 629 |
the cursor range is empty. |
| 630 |
<P> |
| 631 |
<DD><DL> |
| 632 |
</DL> |
| 633 |
</DD> |
| 634 |
<DD><DL> |
| 635 |
<DT><B>Parameters:</B><DD><CODE>lockMode</CODE> - the lock mode to use for this operation, or null to |
| 636 |
use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. |
| 637 |
<DT><B>Returns:</B><DD>the first value, or null if the cursor range is empty. |
| 638 |
<DT><B>Throws:</B> |
| 639 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL> |
| 640 |
</DD> |
| 641 |
</DL> |
| 642 |
<HR> |
| 643 |
|
| 644 |
<A NAME="last()"></A><H3> |
| 645 |
last</H3> |
| 646 |
<PRE> |
| 647 |
<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>last</B>() |
| 648 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 649 |
<DL> |
| 650 |
<DD>Moves the cursor to the last value and returns it, or returns null if |
| 651 |
the cursor range is empty. |
| 652 |
|
| 653 |
<p><A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> |
| 654 |
<P> |
| 655 |
<DD><DL> |
| 656 |
</DL> |
| 657 |
</DD> |
| 658 |
<DD><DL> |
| 659 |
|
| 660 |
<DT><B>Returns:</B><DD>the last value, or null if the cursor range is empty. |
| 661 |
<DT><B>Throws:</B> |
| 662 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL> |
| 663 |
</DD> |
| 664 |
</DL> |
| 665 |
<HR> |
| 666 |
|
| 667 |
<A NAME="last(com.sleepycat.db.LockMode)"></A><H3> |
| 668 |
last</H3> |
| 669 |
<PRE> |
| 670 |
<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) |
| 671 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 672 |
<DL> |
| 673 |
<DD>Moves the cursor to the last value and returns it, or returns null if |
| 674 |
the cursor range is empty. |
| 675 |
<P> |
| 676 |
<DD><DL> |
| 677 |
</DL> |
| 678 |
</DD> |
| 679 |
<DD><DL> |
| 680 |
<DT><B>Parameters:</B><DD><CODE>lockMode</CODE> - the lock mode to use for this operation, or null to |
| 681 |
use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. |
| 682 |
<DT><B>Returns:</B><DD>the last value, or null if the cursor range is empty. |
| 683 |
<DT><B>Throws:</B> |
| 684 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL> |
| 685 |
</DD> |
| 686 |
</DL> |
| 687 |
<HR> |
| 688 |
|
| 689 |
<A NAME="next()"></A><H3> |
| 690 |
next</H3> |
| 691 |
<PRE> |
| 692 |
<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>next</B>() |
| 693 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 694 |
<DL> |
| 695 |
<DD>Moves the cursor to the next value and returns it, or returns null |
| 696 |
if there are no more values in the cursor range. If the cursor is |
| 697 |
uninitialized, this method is equivalent to <A HREF="../../../com/sleepycat/persist/EntityCursor.html#first()"><CODE>first()</CODE></A>. |
| 698 |
|
| 699 |
<p><A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> |
| 700 |
<P> |
| 701 |
<DD><DL> |
| 702 |
<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> |
| 703 |
</DD> |
| 704 |
<DD><DL> |
| 705 |
|
| 706 |
<DT><B>Returns:</B><DD>the next value, or null if there are no more values in the |
| 707 |
cursor range. |
| 708 |
<DT><B>Throws:</B> |
| 709 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL> |
| 710 |
</DD> |
| 711 |
</DL> |
| 712 |
<HR> |
| 713 |
|
| 714 |
<A NAME="next(com.sleepycat.db.LockMode)"></A><H3> |
| 715 |
next</H3> |
| 716 |
<PRE> |
| 717 |
<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) |
| 718 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 719 |
<DL> |
| 720 |
<DD>Moves the cursor to the next value and returns it, or returns null |
| 721 |
if there are no more values in the cursor range. If the cursor is |
| 722 |
uninitialized, this method is equivalent to <A HREF="../../../com/sleepycat/persist/EntityCursor.html#first()"><CODE>first()</CODE></A>. |
| 723 |
<P> |
| 724 |
<DD><DL> |
| 725 |
<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> |
| 726 |
</DD> |
| 727 |
<DD><DL> |
| 728 |
<DT><B>Parameters:</B><DD><CODE>lockMode</CODE> - the lock mode to use for this operation, or null to |
| 729 |
use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. |
| 730 |
<DT><B>Returns:</B><DD>the next value, or null if there are no more values in the |
| 731 |
cursor range. |
| 732 |
<DT><B>Throws:</B> |
| 733 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL> |
| 734 |
</DD> |
| 735 |
</DL> |
| 736 |
<HR> |
| 737 |
|
| 738 |
<A NAME="nextDup()"></A><H3> |
| 739 |
nextDup</H3> |
| 740 |
<PRE> |
| 741 |
<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>nextDup</B>() |
| 742 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 743 |
<DL> |
| 744 |
<DD>Moves the cursor to the next value with the same key (duplicate) and |
| 745 |
returns it, or returns null if no more values are present for the key at |
| 746 |
the current position. |
| 747 |
|
| 748 |
<p><A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> |
| 749 |
<P> |
| 750 |
<DD><DL> |
| 751 |
</DL> |
| 752 |
</DD> |
| 753 |
<DD><DL> |
| 754 |
|
| 755 |
<DT><B>Returns:</B><DD>the next value with the same key, or null if no more values are |
| 756 |
present for the key at the current position. |
| 757 |
<DT><B>Throws:</B> |
| 758 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the cursor is uninitialized. |
| 759 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL> |
| 760 |
</DD> |
| 761 |
</DL> |
| 762 |
<HR> |
| 763 |
|
| 764 |
<A NAME="nextDup(com.sleepycat.db.LockMode)"></A><H3> |
| 765 |
nextDup</H3> |
| 766 |
<PRE> |
| 767 |
<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) |
| 768 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 769 |
<DL> |
| 770 |
<DD>Moves the cursor to the next value with the same key (duplicate) and |
| 771 |
returns it, or returns null if no more values are present for the key at |
| 772 |
the current position. |
| 773 |
<P> |
| 774 |
<DD><DL> |
| 775 |
</DL> |
| 776 |
</DD> |
| 777 |
<DD><DL> |
| 778 |
<DT><B>Parameters:</B><DD><CODE>lockMode</CODE> - the lock mode to use for this operation, or null to |
| 779 |
use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. |
| 780 |
<DT><B>Returns:</B><DD>the next value with the same key, or null if no more values are |
| 781 |
present for the key at the current position. |
| 782 |
<DT><B>Throws:</B> |
| 783 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the cursor is uninitialized. |
| 784 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL> |
| 785 |
</DD> |
| 786 |
</DL> |
| 787 |
<HR> |
| 788 |
|
| 789 |
<A NAME="nextNoDup()"></A><H3> |
| 790 |
nextNoDup</H3> |
| 791 |
<PRE> |
| 792 |
<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>nextNoDup</B>() |
| 793 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 794 |
<DL> |
| 795 |
<DD>Moves the cursor to the next value with a different key and returns it, |
| 796 |
or returns null if there are no more unique keys in the cursor range. |
| 797 |
If the cursor is uninitialized, this method is equivalent to <A HREF="../../../com/sleepycat/persist/EntityCursor.html#first()"><CODE>first()</CODE></A>. |
| 798 |
|
| 799 |
<p><A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> |
| 800 |
<P> |
| 801 |
<DD><DL> |
| 802 |
</DL> |
| 803 |
</DD> |
| 804 |
<DD><DL> |
| 805 |
|
| 806 |
<DT><B>Returns:</B><DD>the next value with a different key, or null if there are no |
| 807 |
more unique keys in the cursor range. |
| 808 |
<DT><B>Throws:</B> |
| 809 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL> |
| 810 |
</DD> |
| 811 |
</DL> |
| 812 |
<HR> |
| 813 |
|
| 814 |
<A NAME="nextNoDup(com.sleepycat.db.LockMode)"></A><H3> |
| 815 |
nextNoDup</H3> |
| 816 |
<PRE> |
| 817 |
<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) |
| 818 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 819 |
<DL> |
| 820 |
<DD>Moves the cursor to the next value with a different key and returns it, |
| 821 |
or returns null if there are no more unique keys in the cursor range. |
| 822 |
If the cursor is uninitialized, this method is equivalent to <A HREF="../../../com/sleepycat/persist/EntityCursor.html#first()"><CODE>first()</CODE></A>. |
| 823 |
<P> |
| 824 |
<DD><DL> |
| 825 |
</DL> |
| 826 |
</DD> |
| 827 |
<DD><DL> |
| 828 |
<DT><B>Parameters:</B><DD><CODE>lockMode</CODE> - the lock mode to use for this operation, or null to |
| 829 |
use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. |
| 830 |
<DT><B>Returns:</B><DD>the next value with a different key, or null if there are no |
| 831 |
more unique keys in the cursor range. |
| 832 |
<DT><B>Throws:</B> |
| 833 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL> |
| 834 |
</DD> |
| 835 |
</DL> |
| 836 |
<HR> |
| 837 |
|
| 838 |
<A NAME="prev()"></A><H3> |
| 839 |
prev</H3> |
| 840 |
<PRE> |
| 841 |
<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>prev</B>() |
| 842 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 843 |
<DL> |
| 844 |
<DD>Moves the cursor to the previous value and returns it, or returns null |
| 845 |
if there are no preceding values in the cursor range. If the cursor is |
| 846 |
uninitialized, this method is equivalent to <A HREF="../../../com/sleepycat/persist/EntityCursor.html#last()"><CODE>last()</CODE></A>. |
| 847 |
|
| 848 |
<p><A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> |
| 849 |
<P> |
| 850 |
<DD><DL> |
| 851 |
</DL> |
| 852 |
</DD> |
| 853 |
<DD><DL> |
| 854 |
|
| 855 |
<DT><B>Returns:</B><DD>the previous value, or null if there are no preceding values in |
| 856 |
the cursor range. |
| 857 |
<DT><B>Throws:</B> |
| 858 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL> |
| 859 |
</DD> |
| 860 |
</DL> |
| 861 |
<HR> |
| 862 |
|
| 863 |
<A NAME="prev(com.sleepycat.db.LockMode)"></A><H3> |
| 864 |
prev</H3> |
| 865 |
<PRE> |
| 866 |
<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) |
| 867 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 868 |
<DL> |
| 869 |
<DD>Moves the cursor to the previous value and returns it, or returns null |
| 870 |
if there are no preceding values in the cursor range. If the cursor is |
| 871 |
uninitialized, this method is equivalent to <A HREF="../../../com/sleepycat/persist/EntityCursor.html#last()"><CODE>last()</CODE></A>. |
| 872 |
<P> |
| 873 |
<DD><DL> |
| 874 |
</DL> |
| 875 |
</DD> |
| 876 |
<DD><DL> |
| 877 |
<DT><B>Parameters:</B><DD><CODE>lockMode</CODE> - the lock mode to use for this operation, or null to |
| 878 |
use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. |
| 879 |
<DT><B>Returns:</B><DD>the previous value, or null if there are no preceding values in |
| 880 |
the cursor range. |
| 881 |
<DT><B>Throws:</B> |
| 882 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL> |
| 883 |
</DD> |
| 884 |
</DL> |
| 885 |
<HR> |
| 886 |
|
| 887 |
<A NAME="prevDup()"></A><H3> |
| 888 |
prevDup</H3> |
| 889 |
<PRE> |
| 890 |
<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>prevDup</B>() |
| 891 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 892 |
<DL> |
| 893 |
<DD>Moves the cursor to the previous value with the same key (duplicate) and |
| 894 |
returns it, or returns null if no preceding values are present for the |
| 895 |
key at the current position. |
| 896 |
|
| 897 |
<p><A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> |
| 898 |
<P> |
| 899 |
<DD><DL> |
| 900 |
</DL> |
| 901 |
</DD> |
| 902 |
<DD><DL> |
| 903 |
|
| 904 |
<DT><B>Returns:</B><DD>the previous value with the same key, or null if no preceding |
| 905 |
values are present for the key at the current position. |
| 906 |
<DT><B>Throws:</B> |
| 907 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the cursor is uninitialized. |
| 908 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL> |
| 909 |
</DD> |
| 910 |
</DL> |
| 911 |
<HR> |
| 912 |
|
| 913 |
<A NAME="prevDup(com.sleepycat.db.LockMode)"></A><H3> |
| 914 |
prevDup</H3> |
| 915 |
<PRE> |
| 916 |
<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) |
| 917 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 918 |
<DL> |
| 919 |
<DD>Moves the cursor to the previous value with the same key (duplicate) and |
| 920 |
returns it, or returns null if no preceding values are present for the |
| 921 |
key at the current position. |
| 922 |
<P> |
| 923 |
<DD><DL> |
| 924 |
</DL> |
| 925 |
</DD> |
| 926 |
<DD><DL> |
| 927 |
<DT><B>Parameters:</B><DD><CODE>lockMode</CODE> - the lock mode to use for this operation, or null to |
| 928 |
use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. |
| 929 |
<DT><B>Returns:</B><DD>the previous value with the same key, or null if no preceding |
| 930 |
values are present for the key at the current position. |
| 931 |
<DT><B>Throws:</B> |
| 932 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the cursor is uninitialized. |
| 933 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL> |
| 934 |
</DD> |
| 935 |
</DL> |
| 936 |
<HR> |
| 937 |
|
| 938 |
<A NAME="prevNoDup()"></A><H3> |
| 939 |
prevNoDup</H3> |
| 940 |
<PRE> |
| 941 |
<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>prevNoDup</B>() |
| 942 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 943 |
<DL> |
| 944 |
<DD>Moves the cursor to the preceding value with a different key and returns |
| 945 |
it, or returns null if there are no preceding unique keys in the cursor |
| 946 |
range. If the cursor is uninitialized, this method is equivalent to |
| 947 |
<A HREF="../../../com/sleepycat/persist/EntityCursor.html#last()"><CODE>last()</CODE></A>. |
| 948 |
|
| 949 |
<p><A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> |
| 950 |
<P> |
| 951 |
<DD><DL> |
| 952 |
</DL> |
| 953 |
</DD> |
| 954 |
<DD><DL> |
| 955 |
|
| 956 |
<DT><B>Returns:</B><DD>the previous value with a different key, or null if there are no |
| 957 |
preceding unique keys in the cursor range. |
| 958 |
<DT><B>Throws:</B> |
| 959 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL> |
| 960 |
</DD> |
| 961 |
</DL> |
| 962 |
<HR> |
| 963 |
|
| 964 |
<A NAME="prevNoDup(com.sleepycat.db.LockMode)"></A><H3> |
| 965 |
prevNoDup</H3> |
| 966 |
<PRE> |
| 967 |
<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) |
| 968 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 969 |
<DL> |
| 970 |
<DD>Moves the cursor to the preceding value with a different key and returns |
| 971 |
it, or returns null if there are no preceding unique keys in the cursor |
| 972 |
range. If the cursor is uninitialized, this method is equivalent to |
| 973 |
<A HREF="../../../com/sleepycat/persist/EntityCursor.html#last()"><CODE>last()</CODE></A>. |
| 974 |
<P> |
| 975 |
<DD><DL> |
| 976 |
</DL> |
| 977 |
</DD> |
| 978 |
<DD><DL> |
| 979 |
<DT><B>Parameters:</B><DD><CODE>lockMode</CODE> - the lock mode to use for this operation, or null to |
| 980 |
use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. |
| 981 |
<DT><B>Returns:</B><DD>the previous value with a different key, or null if there are no |
| 982 |
preceding unique keys in the cursor range. |
| 983 |
<DT><B>Throws:</B> |
| 984 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL> |
| 985 |
</DD> |
| 986 |
</DL> |
| 987 |
<HR> |
| 988 |
|
| 989 |
<A NAME="current()"></A><H3> |
| 990 |
current</H3> |
| 991 |
<PRE> |
| 992 |
<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> <B>current</B>() |
| 993 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 994 |
<DL> |
| 995 |
<DD>Returns the value at the cursor position, or null if the value at the |
| 996 |
cursor position has been deleted. |
| 997 |
|
| 998 |
<p><A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> |
| 999 |
<P> |
| 1000 |
<DD><DL> |
| 1001 |
</DL> |
| 1002 |
</DD> |
| 1003 |
<DD><DL> |
| 1004 |
|
| 1005 |
<DT><B>Returns:</B><DD>the value at the cursor position, or null if it has been |
| 1006 |
deleted. |
| 1007 |
<DT><B>Throws:</B> |
| 1008 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the cursor is uninitialized. |
| 1009 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL> |
| 1010 |
</DD> |
| 1011 |
</DL> |
| 1012 |
<HR> |
| 1013 |
|
| 1014 |
<A NAME="current(com.sleepycat.db.LockMode)"></A><H3> |
| 1015 |
current</H3> |
| 1016 |
<PRE> |
| 1017 |
<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) |
| 1018 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1019 |
<DL> |
| 1020 |
<DD>Returns the value at the cursor position, or null if the value at the |
| 1021 |
cursor position has been deleted. |
| 1022 |
<P> |
| 1023 |
<DD><DL> |
| 1024 |
</DL> |
| 1025 |
</DD> |
| 1026 |
<DD><DL> |
| 1027 |
<DT><B>Parameters:</B><DD><CODE>lockMode</CODE> - the lock mode to use for this operation, or null to |
| 1028 |
use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. |
| 1029 |
<DT><B>Returns:</B><DD>the value at the cursor position, or null if it has been |
| 1030 |
deleted. |
| 1031 |
<DT><B>Throws:</B> |
| 1032 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the cursor is uninitialized. |
| 1033 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL> |
| 1034 |
</DD> |
| 1035 |
</DL> |
| 1036 |
<HR> |
| 1037 |
|
| 1038 |
<A NAME="count()"></A><H3> |
| 1039 |
count</H3> |
| 1040 |
<PRE> |
| 1041 |
int <B>count</B>() |
| 1042 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1043 |
<DL> |
| 1044 |
<DD>Returns the number of values (duplicates) for the key at the cursor |
| 1045 |
position, or returns zero if all values for the key have been deleted. |
| 1046 |
Returns one or zero if the underlying index has unique keys. |
| 1047 |
|
| 1048 |
|
| 1049 |
<p><A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> |
| 1050 |
<P> |
| 1051 |
<DD><DL> |
| 1052 |
</DL> |
| 1053 |
</DD> |
| 1054 |
<DD><DL> |
| 1055 |
|
| 1056 |
<DT><B>Returns:</B><DD>the number of duplicates, or zero if all values for the current |
| 1057 |
key have been deleted. |
| 1058 |
<DT><B>Throws:</B> |
| 1059 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the cursor is uninitialized. |
| 1060 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL> |
| 1061 |
</DD> |
| 1062 |
</DL> |
| 1063 |
<HR> |
| 1064 |
|
| 1065 |
<A NAME="iterator()"></A><H3> |
| 1066 |
iterator</H3> |
| 1067 |
<PRE> |
| 1068 |
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</A><<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>> <B>iterator</B>()</PRE> |
| 1069 |
<DL> |
| 1070 |
<DD>Returns an iterator over the key range, starting with the value |
| 1071 |
following the current position or at the first value if the cursor is |
| 1072 |
uninitialized. |
| 1073 |
|
| 1074 |
<p><A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> |
| 1075 |
<P> |
| 1076 |
<DD><DL> |
| 1077 |
<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><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Iterable.html?is-external=true#iterator()" title="class or interface in java.lang">iterator</A></CODE> in interface <CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A><<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>></CODE></DL> |
| 1078 |
</DD> |
| 1079 |
<DD><DL> |
| 1080 |
|
| 1081 |
<DT><B>Returns:</B><DD>the iterator.</DL> |
| 1082 |
</DD> |
| 1083 |
</DL> |
| 1084 |
<HR> |
| 1085 |
|
| 1086 |
<A NAME="iterator(com.sleepycat.db.LockMode)"></A><H3> |
| 1087 |
iterator</H3> |
| 1088 |
<PRE> |
| 1089 |
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</A><<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> |
| 1090 |
<DL> |
| 1091 |
<DD>Returns an iterator over the key range, starting with the value |
| 1092 |
following the current position or at the first value if the cursor is |
| 1093 |
uninitialized. |
| 1094 |
<P> |
| 1095 |
<DD><DL> |
| 1096 |
<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> |
| 1097 |
</DD> |
| 1098 |
<DD><DL> |
| 1099 |
<DT><B>Parameters:</B><DD><CODE>lockMode</CODE> - the lock mode to use for all operations performed |
| 1100 |
using the iterator, or null to use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. |
| 1101 |
<DT><B>Returns:</B><DD>the iterator.</DL> |
| 1102 |
</DD> |
| 1103 |
</DL> |
| 1104 |
<HR> |
| 1105 |
|
| 1106 |
<A NAME="update(java.lang.Object)"></A><A NAME="update(V)"></A><H3> |
| 1107 |
update</H3> |
| 1108 |
<PRE> |
| 1109 |
boolean <B>update</B>(<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A> entity) |
| 1110 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1111 |
<DL> |
| 1112 |
<DD>Replaces the entity at the cursor position with the given entity. |
| 1113 |
<P> |
| 1114 |
<DD><DL> |
| 1115 |
</DL> |
| 1116 |
</DD> |
| 1117 |
<DD><DL> |
| 1118 |
<DT><B>Parameters:</B><DD><CODE>entity</CODE> - the entity to replace the entity at the current position. |
| 1119 |
<DT><B>Returns:</B><DD>true if successful or false if the entity at the current |
| 1120 |
position was previously deleted. |
| 1121 |
<DT><B>Throws:</B> |
| 1122 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the cursor is uninitialized. |
| 1123 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang">UnsupportedOperationException</A></CODE> - if the index is read only or if |
| 1124 |
the value type is not an entity type. |
| 1125 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL> |
| 1126 |
</DD> |
| 1127 |
</DL> |
| 1128 |
<HR> |
| 1129 |
|
| 1130 |
<A NAME="delete()"></A><H3> |
| 1131 |
delete</H3> |
| 1132 |
<PRE> |
| 1133 |
boolean <B>delete</B>() |
| 1134 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1135 |
<DL> |
| 1136 |
<DD>Deletes the entity at the cursor position. |
| 1137 |
<P> |
| 1138 |
<DD><DL> |
| 1139 |
</DL> |
| 1140 |
</DD> |
| 1141 |
<DD><DL> |
| 1142 |
|
| 1143 |
<DT><B>Returns:</B><DD>true if successful or false if the entity at the current |
| 1144 |
position has been deleted. |
| 1145 |
<DT><B>Throws:</B> |
| 1146 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the cursor is uninitialized. |
| 1147 |
<DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/UnsupportedOperationException.html?is-external=true" title="class or interface in java.lang">UnsupportedOperationException</A></CODE> - if the index is read only. |
| 1148 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL> |
| 1149 |
</DD> |
| 1150 |
</DL> |
| 1151 |
<HR> |
| 1152 |
|
| 1153 |
<A NAME="dup()"></A><H3> |
| 1154 |
dup</H3> |
| 1155 |
<PRE> |
| 1156 |
<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>() |
| 1157 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1158 |
<DL> |
| 1159 |
<DD>Duplicates the cursor at the cursor position. The returned cursor will |
| 1160 |
be initially positioned at the same position as this current cursor, and |
| 1161 |
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>. |
| 1162 |
<P> |
| 1163 |
<DD><DL> |
| 1164 |
</DL> |
| 1165 |
</DD> |
| 1166 |
<DD><DL> |
| 1167 |
|
| 1168 |
<DT><B>Returns:</B><DD>the duplicated cursor. |
| 1169 |
<DT><B>Throws:</B> |
| 1170 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL> |
| 1171 |
</DD> |
| 1172 |
</DL> |
| 1173 |
<HR> |
| 1174 |
|
| 1175 |
<A NAME="close()"></A><H3> |
| 1176 |
close</H3> |
| 1177 |
<PRE> |
| 1178 |
void <B>close</B>() |
| 1179 |
throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> |
| 1180 |
<DL> |
| 1181 |
<DD>Closes the cursor. |
| 1182 |
<P> |
| 1183 |
<DD><DL> |
| 1184 |
<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> |
| 1185 |
</DD> |
| 1186 |
<DD><DL> |
| 1187 |
|
| 1188 |
<DT><B>Throws:</B> |
| 1189 |
<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL> |
| 1190 |
</DD> |
| 1191 |
</DL> |
| 1192 |
|
| 1193 |
<HR> |
| 1194 |
|
| 1195 |
|
| 1196 |
|
| 1197 |
<A NAME="navbar_bottom"></A> |
| 1198 |
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
| 1199 |
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| 1200 |
<TR> |
| 1201 |
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| 1202 |
<A NAME="navbar_bottom_firstrow"></A> |
| 1203 |
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| 1204 |
<TR ALIGN="center" VALIGN="top"> |
| 1205 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| 1206 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| 1207 |
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| 1208 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/EntityCursor.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| 1209 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| 1210 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| 1211 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| 1212 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| 1213 |
</TR> |
| 1214 |
</TABLE> |
| 1215 |
</TD> |
| 1216 |
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| 1217 |
<b>Berkeley DB</b><br><font size="-1"> version 5.3.28</font></EM> |
| 1218 |
</TD> |
| 1219 |
</TR> |
| 1220 |
|
| 1221 |
<TR> |
| 1222 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 1223 |
<A HREF="../../../com/sleepycat/persist/DatabaseNamer.html" title="interface in com.sleepycat.persist"><B>PREV CLASS</B></A> |
| 1224 |
<A HREF="../../../com/sleepycat/persist/EntityIndex.html" title="interface in com.sleepycat.persist"><B>NEXT CLASS</B></A></FONT></TD> |
| 1225 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 1226 |
<A HREF="../../../index.html?com/sleepycat/persist/EntityCursor.html" target="_top"><B>FRAMES</B></A> |
| 1227 |
<A HREF="EntityCursor.html" target="_top"><B>NO FRAMES</B></A> |
| 1228 |
<SCRIPT type="text/javascript"> |
| 1229 |
<!-- |
| 1230 |
if(window==top) { |
| 1231 |
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
| 1232 |
} |
| 1233 |
//--> |
| 1234 |
</SCRIPT> |
| 1235 |
<NOSCRIPT> |
| 1236 |
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> |
| 1237 |
</NOSCRIPT> |
| 1238 |
|
| 1239 |
|
| 1240 |
</FONT></TD> |
| 1241 |
</TR> |
| 1242 |
<TR> |
| 1243 |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| 1244 |
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| 1245 |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| 1246 |
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| 1247 |
</TR> |
| 1248 |
</TABLE> |
| 1249 |
<A NAME="skip-navbar_bottom"></A> |
| 1250 |
|
| 1251 |
|
| 1252 |
<HR> |
| 1253 |
<font size=1>Copyright (c) 1996, 2013 Oracle and/or its affiliates. All rights reserved.</font> |
| 1254 |
</BODY> |
| 1255 |
</HTML> |