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.
|
clone
public SqlJetBtreeCursor(SqlJetBtree btree, int table, boolean wrFlag, ISqlJetKeyInfo keyInfo) throws SqlJetException
sqlJetBtree
- table
- wrFlag2
- keyInfo
- SqlJetException
public void clearCursor()
ISqlJetBtreeCursor
clearCursor
in interface ISqlJetBtreeCursor
public void closeCursor() throws SqlJetException
ISqlJetBtreeCursor
closeCursor
in interface ISqlJetBtreeCursor
SqlJetException
public int moveTo(ISqlJetMemoryPointer pKey, long nKey, boolean bias) throws SqlJetException
ISqlJetBtreeCursor
moveTo
in interface ISqlJetBtreeCursor
pKey
- Packed key if the btree is an indexnKey
- Integer key for tables. Size of pKey for indicesbias
- Bias search to the high endSqlJetException
public int moveToUnpacked(ISqlJetUnpackedRecord pIdxKey, long intKey, boolean biasRight) throws SqlJetException
ISqlJetBtreeCursor
moveToUnpacked
in interface ISqlJetBtreeCursor
SqlJetException
public void restoreCursorPosition() throws SqlJetException
restoreCursorPosition
in interface ISqlJetBtreeCursor
SqlJetException
public boolean cursorHasMoved()
ISqlJetBtreeCursor
cursorHasMoved
in interface ISqlJetBtreeCursor
public void delete() throws SqlJetException
ISqlJetBtreeCursor
delete
in interface ISqlJetBtreeCursor
SqlJetException
public void insert(ISqlJetMemoryPointer pKey, long nKey, ISqlJetMemoryPointer pData, int nData, int zero, boolean bias) throws SqlJetException
ISqlJetBtreeCursor
insert
in interface ISqlJetBtreeCursor
pKey
- 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 appendSqlJetException
public boolean first() throws SqlJetException
ISqlJetBtreeCursor
first
in interface ISqlJetBtreeCursor
SqlJetException
public boolean last() throws SqlJetException
ISqlJetBtreeCursor
last
in interface ISqlJetBtreeCursor
SqlJetException
public boolean next() throws SqlJetException
ISqlJetBtreeCursor
next
in interface ISqlJetBtreeCursor
SqlJetException
public boolean previous() throws SqlJetException
ISqlJetBtreeCursor
previous
in interface ISqlJetBtreeCursor
SqlJetException
public boolean eof()
ISqlJetBtreeCursor
eof
in interface ISqlJetBtreeCursor
public short flags() throws SqlJetException
ISqlJetBtreeCursor
flags
in interface ISqlJetBtreeCursor
SqlJetException
public long getKeySize() throws SqlJetException
ISqlJetBtreeCursor
getKeySize
in interface ISqlJetBtreeCursor
SqlJetException
public void key(int offset, int amt, ISqlJetMemoryPointer buf) throws SqlJetException
ISqlJetBtreeCursor
key
in interface ISqlJetBtreeCursor
SqlJetException
public ISqlJetDbHandle getCursorDb()
ISqlJetBtreeCursor
getCursorDb
in interface ISqlJetBtreeCursor
public ISqlJetMemoryPointer keyFetch(int[] amt)
ISqlJetBtreeCursor
keyFetch
in interface ISqlJetBtreeCursor
public ISqlJetMemoryPointer dataFetch(int[] amt)
ISqlJetBtreeCursor
dataFetch
in interface ISqlJetBtreeCursor
public int getDataSize() throws SqlJetException
ISqlJetBtreeCursor
getDataSize
in interface ISqlJetBtreeCursor
SqlJetException
public void data(int offset, int amt, ISqlJetMemoryPointer buf) throws SqlJetException
ISqlJetBtreeCursor
data
in interface ISqlJetBtreeCursor
SqlJetException
public void putData(int offset, int amt, ISqlJetMemoryPointer data) throws SqlJetException
ISqlJetBtreeCursor
putData
in interface ISqlJetBtreeCursor
SqlJetException
public void cacheOverflow()
ISqlJetBtreeCursor
cacheOverflow
in interface ISqlJetBtreeCursor
public boolean saveCursorPosition() throws SqlJetException
saveCursorPosition
in interface ISqlJetBtreeCursor
SqlJetException
public void enterCursor()
ISqlJetBtreeCursor
enterCursor
in interface ISqlJetBtreeCursor
public void leaveCursor()
ISqlJetBtreeCursor
leaveCursor
in interface ISqlJetBtreeCursor
Copyright © 2009-2010 TMate Software Ltd. All Rights Reserved.