|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.impl.service.data.store.db.je.JeCursor
public class JeCursor
Provides a cursor implementation using Berkeley DB Java Edition.
| Constructor Summary | |
|---|---|
JeCursor(com.sleepycat.je.Database db,
com.sleepycat.je.Transaction txn)
Creates an instance of this class. |
|
| Method Summary | |
|---|---|
void |
close()
Closes this cursor, releasing any associated resources. |
boolean |
findFirst()
Searches for the first key in the database. |
boolean |
findLast()
Searches for the last key in the database. |
boolean |
findNext()
Searches for the next key in the database. |
boolean |
findNext(byte[] key)
Searches for the first key that is greater than or equal to the specified key. |
byte[] |
getKey()
Returns the current key, or null if the cursor has no current
key. |
byte[] |
getValue()
Returns the current value, or null if the cursor has no current
value. |
boolean |
putNoOverwrite(byte[] key,
byte[] value)
Uses the cursor to set the value associated with a key in the database, if the key does not already have an associated value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
JeCursor(com.sleepycat.je.Database db,
com.sleepycat.je.Transaction txn)
db - the Berkeley DB databasetxn - the Berkeley DB transaction
TransactionAbortedException - if the transaction should be
aborted due to timeout or conflict
DbDatabaseException - if an unexpected database problem occurs| Method Detail |
|---|
public byte[] getKey()
null if the cursor has no current
key.
getKey in interface DbCursornullpublic byte[] getValue()
null if the cursor has no current
value.
getValue in interface DbCursornullpublic boolean findFirst()
true, then sets the current key and value to the first key and its
associated value.
findFirst in interface DbCursortrue if the first key was found, else falsepublic boolean findNext()
true,
then sets the current key and value to the key found and its associated
value.
findNext in interface DbCursortrue if the next key was found, else falsepublic boolean findNext(byte[] key)
true, then sets the current key
and value to the key found and its associated value.
findNext in interface DbCursorkey - the key at which to start searching
true if the next key was found, else falsepublic boolean findLast()
true, then sets the current key and value to the last key and its
associated value.
findLast in interface DbCursortrue if the last key was found, else false
public boolean putNoOverwrite(byte[] key,
byte[] value)
true, then sets the current key and value to the newly inserted
key and its associated value.
putNoOverwrite in interface DbCursorkey - the keyvalue - the value
true if a value was stored for the key, and false if the key already had a valuepublic void close()
Note that the Berkeley DB documentation for prepare doesn't say you need to close cursors, but my testing shows that you do. -tjb@sun.com (12/14/2006)
close in interface DbCursor
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||