public class SqlJetBtreeCursor extends SqlJetCloneable implements ISqlJetBtreeCursor
BTCURSOR_MAX_DEPTH| Constructor and Description |
|---|
SqlJetBtreeCursor(SqlJetBtree btree,
int table,
boolean wrFlag,
ISqlJetKeyInfo keyInfo)
Create a new cursor for the BTree whose root is on the page iTable.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cacheOverflow()
Set a flag on this cursor to cache the locations of pages from the
overflow list for the current row.
|
void |
clearCursor()
Clear the current cursor position.
|
void |
closeCursor()
Close a cursor.
|
boolean |
cursorHasMoved()
Determine whether or not a cursor has moved from the position it
was last placed at.
|
void |
data(int offset,
int amt,
ISqlJetMemoryPointer buf)
Read part of the data associated with cursor pCur.
|
ISqlJetMemoryPointer |
dataFetch(int[] amt)
For the entry that cursor pCur is point to, return as
many bytes of the key or data as are available on the local
b-tree page.
|
void |
delete()
Delete the entry that the cursor is pointing to.
|
void |
enterCursor()
Enter a mutex on a Btree given a cursor owned by that
Btree.
|
boolean |
eof()
Return TRUE if the cursor is not pointing at an entry of the table.
|
boolean |
first()
Move the cursor to the first entry in the table.
|
short |
flags()
Return the flag byte at the beginning of the page that the cursor
is currently pointing to.
|
ISqlJetDbHandle |
getCursorDb()
Return the database connection handle for a cursor.
|
int |
getDataSize()
Return the number of bytes of data in the entry the
cursor currently points to.
|
long |
getKeySize()
Returns the size of the buffer needed to hold the value of
the key for the current entry.
|
void |
insert(ISqlJetMemoryPointer pKey,
long nKey,
ISqlJetMemoryPointer pData,
int nData,
int zero,
boolean bias)
Insert a new record into the BTree.
|
void |
key(int offset,
int amt,
ISqlJetMemoryPointer buf)
Read part of the key associated with cursor pCur.
|
ISqlJetMemoryPointer |
keyFetch(int[] amt)
For the entry that cursor pCur is point to, return as
many bytes of the key or data as are available on the local
b-tree page.
|
boolean |
last()
Move the cursor to the last entry in the table.
|
void |
leaveCursor()
Leave a mutex on a Btree given a cursor owned by that
Btree.
|
int |
moveTo(ISqlJetMemoryPointer pKey,
long nKey,
boolean bias)
In this version of moveTo(), pKey is a packed index record
such as is generated by the OP_MakeRecord opcode.
|
int |
moveToUnpacked(ISqlJetUnpackedRecord pIdxKey,
long intKey,
boolean biasRight)
Move the cursor so that it points to an entry near the key
specified by pIdxKey or intKey.
|
boolean |
next()
Advance the cursor to the next entry in the database.
|
boolean |
previous()
Step the cursor to the back to the previous entry in the database.
|
void |
putData(int offset,
int amt,
ISqlJetMemoryPointer data)
Must be a cursor opened for writing on an
INTKEY table currently pointing at a valid table entry.
|
void |
restoreCursorPosition()
Restore the cursor to the position it was in (or as close to as possible)
when saveCursorPosition() was called.
|
boolean |
saveCursorPosition()
Save the current cursor position in the variables BtCursor.nKey and
BtCursor.pKey.
|
clonepublic SqlJetBtreeCursor(SqlJetBtree btree, int table, boolean wrFlag, ISqlJetKeyInfo keyInfo) throws SqlJetException
sqlJetBtree - table - wrFlag2 - keyInfo - SqlJetExceptionpublic void clearCursor()
ISqlJetBtreeCursorclearCursor in interface ISqlJetBtreeCursorpublic void closeCursor()
throws SqlJetException
ISqlJetBtreeCursorcloseCursor in interface ISqlJetBtreeCursorSqlJetExceptionpublic int moveTo(ISqlJetMemoryPointer pKey, long nKey, boolean bias) throws SqlJetException
ISqlJetBtreeCursormoveTo in interface ISqlJetBtreeCursorpKey - Packed key if the btree is an indexnKey - Integer key for tables. Size of pKey for indicesbias - Bias search to the high endSqlJetExceptionpublic int moveToUnpacked(ISqlJetUnpackedRecord pIdxKey, long intKey, boolean biasRight) throws SqlJetException
ISqlJetBtreeCursormoveToUnpacked in interface ISqlJetBtreeCursorSqlJetExceptionpublic void restoreCursorPosition()
throws SqlJetException
restoreCursorPosition in interface ISqlJetBtreeCursorSqlJetExceptionpublic boolean cursorHasMoved()
ISqlJetBtreeCursorcursorHasMoved in interface ISqlJetBtreeCursorpublic void delete()
throws SqlJetException
ISqlJetBtreeCursordelete in interface ISqlJetBtreeCursorSqlJetExceptionpublic void insert(ISqlJetMemoryPointer pKey, long nKey, ISqlJetMemoryPointer pData, int nData, int zero, boolean bias) throws SqlJetException
ISqlJetBtreeCursorinsert in interface ISqlJetBtreeCursorpKey - The key of the new recordnKey - The key of the new recordpData - The data of the new recordnData - The data of the new recordzero - Number of extra 0 bytes to append to databias - True if this is likely an appendSqlJetExceptionpublic boolean first()
throws SqlJetException
ISqlJetBtreeCursorfirst in interface ISqlJetBtreeCursorSqlJetExceptionpublic boolean last()
throws SqlJetException
ISqlJetBtreeCursorlast in interface ISqlJetBtreeCursorSqlJetExceptionpublic boolean next()
throws SqlJetException
ISqlJetBtreeCursornext in interface ISqlJetBtreeCursorSqlJetExceptionpublic boolean previous()
throws SqlJetException
ISqlJetBtreeCursorprevious in interface ISqlJetBtreeCursorSqlJetExceptionpublic boolean eof()
ISqlJetBtreeCursoreof in interface ISqlJetBtreeCursorpublic short flags()
throws SqlJetException
ISqlJetBtreeCursorflags in interface ISqlJetBtreeCursorSqlJetExceptionpublic long getKeySize()
throws SqlJetException
ISqlJetBtreeCursorgetKeySize in interface ISqlJetBtreeCursorSqlJetExceptionpublic void key(int offset,
int amt,
ISqlJetMemoryPointer buf)
throws SqlJetException
ISqlJetBtreeCursorkey in interface ISqlJetBtreeCursorSqlJetExceptionpublic ISqlJetDbHandle getCursorDb()
ISqlJetBtreeCursorgetCursorDb in interface ISqlJetBtreeCursorpublic ISqlJetMemoryPointer keyFetch(int[] amt)
ISqlJetBtreeCursorkeyFetch in interface ISqlJetBtreeCursorpublic ISqlJetMemoryPointer dataFetch(int[] amt)
ISqlJetBtreeCursordataFetch in interface ISqlJetBtreeCursorpublic int getDataSize()
throws SqlJetException
ISqlJetBtreeCursorgetDataSize in interface ISqlJetBtreeCursorSqlJetExceptionpublic void data(int offset,
int amt,
ISqlJetMemoryPointer buf)
throws SqlJetException
ISqlJetBtreeCursordata in interface ISqlJetBtreeCursorSqlJetExceptionpublic void putData(int offset,
int amt,
ISqlJetMemoryPointer data)
throws SqlJetException
ISqlJetBtreeCursorputData in interface ISqlJetBtreeCursorSqlJetExceptionpublic void cacheOverflow()
ISqlJetBtreeCursorcacheOverflow in interface ISqlJetBtreeCursorpublic boolean saveCursorPosition()
throws SqlJetException
saveCursorPosition in interface ISqlJetBtreeCursorSqlJetExceptionpublic void enterCursor()
ISqlJetBtreeCursorenterCursor in interface ISqlJetBtreeCursorpublic void leaveCursor()
ISqlJetBtreeCursorleaveCursor in interface ISqlJetBtreeCursorCopyright © 2009-2010 TMate Software Ltd. All Rights Reserved.