File: EntityCursor.html

package info (click to toggle)
db5.3 5.3.28%2Bdfsg1-0.5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 158,360 kB
  • sloc: ansic: 448,411; java: 111,824; tcl: 80,544; sh: 44,326; cs: 33,697; cpp: 21,604; perl: 14,557; xml: 10,799; makefile: 4,077; yacc: 1,003; awk: 965; sql: 801; erlang: 342; python: 216; php: 24; asm: 14
file content (1255 lines) | stat: -rw-r--r-- 68,665 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
<!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_51) on Mon Sep 09 11:47:06 EDT 2013 -->
<TITLE>
EntityCursor (Oracle - Berkeley DB Java API)
</TITLE>

<META NAME="date" CONTENT="2013-09-09">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../style.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="EntityCursor (Oracle - Berkeley DB Java API)";
    }
}
</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>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/EntityCursor.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>Berkeley DB</b><br><font size="-1"> version 5.3.28</font></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../com/sleepycat/persist/DatabaseNamer.html" title="interface in com.sleepycat.persist"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<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>  &nbsp;
&nbsp;<A HREF="EntityCursor.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<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&lt;V&gt;</H2>
<DL>
<DT><B>All Superinterfaces:</B> <DD><A HREF="../../../com/sleepycat/persist/ForwardCursor.html" title="interface in com.sleepycat.persist">ForwardCursor</A>&lt;V&gt;, <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>&lt;V&gt;</DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <B>EntityCursor&lt;V&gt;</B><DT>extends <A HREF="../../../com/sleepycat/persist/ForwardCursor.html" title="interface in com.sleepycat.persist">ForwardCursor</A>&lt;V&gt;</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&lt;Long, Employee&gt;</code> primaryIndex =
     store.getPrimaryIndex(Long.class, Employee.class);

 <code>EntityCursor&lt;Employee&gt;</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 <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
 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&lt;Employee&gt;</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&lt;Employee&gt;</code> cursor = primaryIndex.entities();
 try {
     <code>Iterator&lt;Employee&gt;</code> i = cursor.iterator();
     while (i.hasNext()) {
          Employee entity = i.next();
         // Do something with the entity...
     }
 } finally {
     cursor.close();
 }</pre>

 <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>
 to allow using the cursor as the target of a Java "foreach" statement:</p>

 <pre class="code">
 <code>EntityCursor&lt;Employee&gt;</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 <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
 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&lt;Employee&gt;</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&lt;String, Long, Employee&gt;</code> secondaryIndex =
     store.getSecondaryIndex(primaryIndex, String.class, "department");

 String regex = ...;
 <code>EntityCursor&lt;Employee&gt;</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&lt;String, Long, Employee&gt;</code> secondaryIndex =
     store.getSecondaryIndex(primaryIndex, String.class, "department");

 String regex = ...;
 <code>EntityCursor&lt;Employee&gt;</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&lt;Employee&gt;</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>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#close()">close</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Closes the cursor.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#count()">count</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<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>&nbsp;lockMode)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#delete()">delete</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A>&lt;<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#dup()">dup</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<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>&nbsp;lockMode)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<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>&lt;<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityCursor.html#iterator()">iterator</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<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>&lt;<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>&gt;</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>&nbsp;lockMode)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<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>&nbsp;lockMode)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<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>&nbsp;lockMode)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<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>&nbsp;lockMode)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<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>&nbsp;lockMode)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<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>&nbsp;lockMode)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<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>&nbsp;lockMode)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<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>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;<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>&nbsp;lockMode)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;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>&nbsp;entity)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Replaces the entity at the cursor position with the given entity.</TD>
</TR>
</TABLE>
&nbsp;
<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> - the base class for all BDB exceptions.</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>&nbsp;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> - the base class for all BDB exceptions.</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> - the base class for all BDB exceptions.</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>&nbsp;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> - the base class for all BDB exceptions.</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>&lt;<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>&gt;</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> - the base class for all BDB exceptions.</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>&nbsp;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>&lt;<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>&gt;</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> - the base class for all BDB exceptions.</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><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.
<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>
</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>&nbsp;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><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.
<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>
</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> - the base class for all BDB exceptions.</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>&nbsp;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> - the base class for all BDB exceptions.</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> - the base class for all BDB exceptions.</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>&nbsp;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> - the base class for all BDB exceptions.</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><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.
<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>
</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>&nbsp;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><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.
<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>
</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> - the base class for all BDB exceptions.</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>&nbsp;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> - the base class for all BDB exceptions.</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><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.
<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>
</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>&nbsp;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><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.
<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>
</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><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.
<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>
</DD>
</DL>
<HR>

<A NAME="iterator()"><!-- --></A><H3>
iterator</H3>
<PRE>
<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>&lt;<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>&gt; <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>&lt;<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>&gt;</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>&lt;<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>&gt;</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>
<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>&lt;<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>&gt; <B>iterator</B>(<A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A>&nbsp;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>&lt;<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>&gt;</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>&nbsp;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><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.
<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
 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> - the base class for all BDB exceptions.</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><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.
<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.
<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>
</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>&lt;<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>&gt; <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> - the base class for all BDB exceptions.</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>&lt;<A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="type parameter in EntityCursor">V</A>&gt;</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> - the base class for all BDB exceptions.</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>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/EntityCursor.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>Berkeley DB</b><br><font size="-1"> version 5.3.28</font></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../com/sleepycat/persist/DatabaseNamer.html" title="interface in com.sleepycat.persist"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<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>  &nbsp;
&nbsp;<A HREF="EntityCursor.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
<font size=1>Copyright (c) 1996, 2013 Oracle and/or its affiliates.  All rights reserved.</font>
</BODY>
</HTML>