Class SqlJetBtreeTable
java.lang.Object
org.tmatesoft.sqljet.core.internal.table.SqlJetBtreeTable
- All Implemented Interfaces:
ISqlJetBtreeTable
- Direct Known Subclasses:
SqlJetBtreeDataTable
,SqlJetBtreeIndexTable
,SqlJetBtreeSchemaTable
,SqlJetMapIndexCursor
,SqlJetMapTableCursor
- Author:
- TMate Software Ltd., Sergey Scherbina (sergey.scherbina@gmail.com)
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ISqlJetBtree
protected boolean
protected int
protected boolean
-
Constructor Summary
ConstructorsConstructorDescriptionSqlJetBtreeTable
(ISqlJetBtree btree, int rootPage, boolean write, boolean index) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected static boolean
checkField
(ISqlJetBtreeRecord record, int field) void
clear()
protected void
void
close()
Close B-Tree table cursor.void
delete()
boolean
eof()
Check of end of B-Tree table cursor.boolean
first()
Go to first record.getBlob
(int field) Get field's value as BLOB.protected ISqlJetBtreeCursor
int
Get count of fields in current record.getFieldType
(int field) Get type of field.double
getFloat
(int field) Get field's value as real (float).long
getInteger
(int field) Get field's value as integer.protected SqlJetKeyInfo
long
getString
(int field) Get field's value as string.getValue
(int field) Get value as object.protected ISqlJetVdbeMem
getValueMem
(int field) Object[]
Get values as objects.getValueUncached
(int field) boolean
hasMoved()
Returns true if cursor has been moved.void
insert
(ISqlJetMemoryPointer pKey, long nKey, ISqlJetMemoryPointer pData, int nData, int nZero, boolean bias) boolean
isNull
(int field) Check to field has null value.boolean
last()
Go to last record.void
lock()
Lock B-Tree table cursor's mutex.void
lockTable
(boolean write) int
moveTo
(ISqlJetMemoryPointer pKey, long nKey, boolean bias) long
newRowId()
long
newRowId
(long prev) Get a new integer record number (a.k.a "rowid") used as the key to a table.boolean
next()
Go to next record.boolean
popState()
Restores previously saved state if there any.boolean
previous()
Go to previous record.void
Saves current state of this table and sets it to point to the first record.void
unlock()
Unlock B-Tree table cursror's mutex.
-
Field Details
-
btree
-
rootPage
protected int rootPage -
write
protected boolean write -
index
protected boolean index
-
-
Constructor Details
-
SqlJetBtreeTable
public SqlJetBtreeTable(ISqlJetBtree btree, int rootPage, boolean write, boolean index) throws SqlJetException - Parameters:
db
-btree
-rootPage
-write
-index
-- Throws:
SqlJetException
-
-
Method Details
-
getCursor
-
getKeyInfo
-
pushState
Description copied from interface:ISqlJetBtreeTable
Saves current state of this table and sets it to point to the first record.- Specified by:
pushState
in interfaceISqlJetBtreeTable
- Throws:
SqlJetException
-
adjustKeyInfo
- Throws:
SqlJetException
-
popState
Description copied from interface:ISqlJetBtreeTable
Restores previously saved state if there any.- Specified by:
popState
in interfaceISqlJetBtreeTable
- Returns:
- Throws:
SqlJetException
-
close
Description copied from interface:ISqlJetBtreeTable
Close B-Tree table cursor.- Specified by:
close
in interfaceISqlJetBtreeTable
- Throws:
SqlJetException
-
unlock
public void unlock()Description copied from interface:ISqlJetBtreeTable
Unlock B-Tree table cursror's mutex.- Specified by:
unlock
in interfaceISqlJetBtreeTable
-
lock
Description copied from interface:ISqlJetBtreeTable
Lock B-Tree table cursor's mutex.- Specified by:
lock
in interfaceISqlJetBtreeTable
- Throws:
SqlJetException
-
eof
Description copied from interface:ISqlJetBtreeTable
Check of end of B-Tree table cursor.- Specified by:
eof
in interfaceISqlJetBtreeTable
- Returns:
- true if there is not more records.
- Throws:
SqlJetException
-
hasMoved
Description copied from interface:ISqlJetBtreeTable
Returns true if cursor has been moved. Side effect of this is restore position of cursor.- Specified by:
hasMoved
in interfaceISqlJetBtreeTable
- Returns:
- Throws:
SqlJetException
-
first
Description copied from interface:ISqlJetBtreeTable
Go to first record.- Specified by:
first
in interfaceISqlJetBtreeTable
- Returns:
- true if there is at least one record.
- Throws:
SqlJetException
-
last
Description copied from interface:ISqlJetBtreeTable
Go to last record.- Specified by:
last
in interfaceISqlJetBtreeTable
- Returns:
- true if there is at least one record.
- Throws:
SqlJetException
-
next
Description copied from interface:ISqlJetBtreeTable
Go to next record.- Specified by:
next
in interfaceISqlJetBtreeTable
- Returns:
- true if there is at least one record and end of cursor is not reached yet
- Throws:
SqlJetException
-
previous
Description copied from interface:ISqlJetBtreeTable
Go to previous record.- Specified by:
previous
in interfaceISqlJetBtreeTable
- Returns:
- true if there is at least one record and begin of cursor is not reached yet
- Throws:
SqlJetException
-
getRecord
- Specified by:
getRecord
in interfaceISqlJetBtreeTable
- Returns:
- Throws:
SqlJetException
-
lockTable
public void lockTable(boolean write) - Specified by:
lockTable
in interfaceISqlJetBtreeTable
-
getEncoding
- Specified by:
getEncoding
in interfaceISqlJetBtreeTable
- Returns:
- Throws:
SqlJetException
-
checkField
- Throws:
SqlJetException
-
getValueMem
- Throws:
SqlJetException
-
getValue
Description copied from interface:ISqlJetBtreeTable
Get value as object.- Specified by:
getValue
in interfaceISqlJetBtreeTable
- Returns:
- Throws:
SqlJetException
-
getValueUncached
- Throws:
SqlJetException
-
getFieldsCount
Description copied from interface:ISqlJetBtreeTable
Get count of fields in current record.- Specified by:
getFieldsCount
in interfaceISqlJetBtreeTable
- Returns:
- count of fields
- Throws:
SqlJetException
-
isNull
Description copied from interface:ISqlJetBtreeTable
Check to field has null value.- Specified by:
isNull
in interfaceISqlJetBtreeTable
- Parameters:
field
- number of field begin from zero- Returns:
- true if field value is null
- Throws:
SqlJetException
-
getString
Description copied from interface:ISqlJetBtreeTable
Get field's value as string.- Specified by:
getString
in interfaceISqlJetBtreeTable
- Parameters:
field
- number of field begin from zero- Returns:
- field's value as string
- Throws:
SqlJetException
-
getInteger
Description copied from interface:ISqlJetBtreeTable
Get field's value as integer.- Specified by:
getInteger
in interfaceISqlJetBtreeTable
- Parameters:
field
- number of field begin from zero- Returns:
- field's value as integer
- Throws:
SqlJetException
-
getFloat
Description copied from interface:ISqlJetBtreeTable
Get field's value as real (float).- Specified by:
getFloat
in interfaceISqlJetBtreeTable
- Parameters:
field
- number of field begin from zero- Returns:
- field's value as real
- Throws:
SqlJetException
-
getFieldType
Description copied from interface:ISqlJetBtreeTable
Get type of field.- Specified by:
getFieldType
in interfaceISqlJetBtreeTable
- Parameters:
field
- number of field begin from zero- Returns:
- type of field
- Throws:
SqlJetException
-
getBlob
Description copied from interface:ISqlJetBtreeTable
Get field's value as BLOB.- Specified by:
getBlob
in interfaceISqlJetBtreeTable
- Parameters:
field
- number of field begin from zero- Returns:
- field's value as BLOB
- Throws:
SqlJetException
-
getValues
Description copied from interface:ISqlJetBtreeTable
Get values as objects.- Specified by:
getValues
in interfaceISqlJetBtreeTable
- Returns:
- Throws:
SqlJetException
-
newRowId
- Specified by:
newRowId
in interfaceISqlJetBtreeTable
- Returns:
- Throws:
SqlJetException
-
newRowId
Get a new integer record number (a.k.a "rowid") used as the key to a table. The record number is not previously used as a key in the database table that cursor P1 points to. The new record number is written written to register P2. Prev is the largest previously generated record number. No new record numbers are allowed to be less than this value. When this value reaches its maximum, a SQLITE_FULL error is generated. This mechanism is used to help implement the AUTOINCREMENT feature.- Specified by:
newRowId
in interfaceISqlJetBtreeTable
- Parameters:
prev
-- Returns:
- Throws:
SqlJetException
-
clearRecordCache
protected void clearRecordCache() -
clear
- Specified by:
clear
in interfaceISqlJetBtreeTable
- Throws:
SqlJetException
-
getKeySize
- Specified by:
getKeySize
in interfaceISqlJetBtreeTable
- Returns:
- Throws:
SqlJetException
-
moveTo
- Specified by:
moveTo
in interfaceISqlJetBtreeTable
- Returns:
- Throws:
SqlJetException
-
insert
public void insert(ISqlJetMemoryPointer pKey, long nKey, ISqlJetMemoryPointer pData, int nData, int nZero, boolean bias) throws SqlJetException - Specified by:
insert
in interfaceISqlJetBtreeTable
- Parameters:
object
-rowId
-pData
-remaining
-i
-b
-- Throws:
SqlJetException
-
delete
- Specified by:
delete
in interfaceISqlJetBtreeTable
- Throws:
SqlJetException
-