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 ISqlJetBtreeprotected booleanprotected intprotected boolean -
Constructor Summary
ConstructorsConstructorDescriptionSqlJetBtreeTable(ISqlJetBtree btree, int rootPage, boolean write, boolean index) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected static booleancheckField(ISqlJetBtreeRecord record, int field) voidclear()protected voidvoidclose()Close B-Tree table cursor.voiddelete()booleaneof()Check of end of B-Tree table cursor.booleanfirst()Go to first record.getBlob(int field) Get field's value as BLOB.protected ISqlJetBtreeCursorintGet count of fields in current record.getFieldType(int field) Get type of field.doublegetFloat(int field) Get field's value as real (float).longgetInteger(int field) Get field's value as integer.protected SqlJetKeyInfolonggetString(int field) Get field's value as string.getValue(int field) Get value as object.protected ISqlJetVdbeMemgetValueMem(int field) Object[]Get values as objects.getValueUncached(int field) booleanhasMoved()Returns true if cursor has been moved.voidinsert(ISqlJetMemoryPointer pKey, long nKey, ISqlJetMemoryPointer pData, int nData, int nZero, boolean bias) booleanisNull(int field) Check to field has null value.booleanlast()Go to last record.voidlock()Lock B-Tree table cursor's mutex.voidlockTable(boolean write) intmoveTo(ISqlJetMemoryPointer pKey, long nKey, boolean bias) longnewRowId()longnewRowId(long prev) Get a new integer record number (a.k.a "rowid") used as the key to a table.booleannext()Go to next record.booleanpopState()Restores previously saved state if there any.booleanprevious()Go to previous record.voidSaves current state of this table and sets it to point to the first record.voidunlock()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:
btree-rootPage-write-index-db-- Throws:
SqlJetException
-
-
Method Details
-
getCursor
-
getKeyInfo
-
pushState
Description copied from interface:ISqlJetBtreeTableSaves current state of this table and sets it to point to the first record.- Specified by:
pushStatein interfaceISqlJetBtreeTable- Throws:
SqlJetException
-
adjustKeyInfo
- Throws:
SqlJetException
-
popState
Description copied from interface:ISqlJetBtreeTableRestores previously saved state if there any.- Specified by:
popStatein interfaceISqlJetBtreeTable- Returns:
- Throws:
SqlJetException
-
close
Description copied from interface:ISqlJetBtreeTableClose B-Tree table cursor.- Specified by:
closein interfaceISqlJetBtreeTable- Throws:
SqlJetException
-
unlock
public void unlock()Description copied from interface:ISqlJetBtreeTableUnlock B-Tree table cursror's mutex.- Specified by:
unlockin interfaceISqlJetBtreeTable
-
lock
Description copied from interface:ISqlJetBtreeTableLock B-Tree table cursor's mutex.- Specified by:
lockin interfaceISqlJetBtreeTable- Throws:
SqlJetException
-
eof
Description copied from interface:ISqlJetBtreeTableCheck of end of B-Tree table cursor.- Specified by:
eofin interfaceISqlJetBtreeTable- Returns:
- true if there is not more records.
- Throws:
SqlJetException
-
hasMoved
Description copied from interface:ISqlJetBtreeTableReturns true if cursor has been moved. Side effect of this is restore position of cursor.- Specified by:
hasMovedin interfaceISqlJetBtreeTable- Returns:
- Throws:
SqlJetException
-
first
Description copied from interface:ISqlJetBtreeTableGo to first record.- Specified by:
firstin interfaceISqlJetBtreeTable- Returns:
- true if there is at least one record.
- Throws:
SqlJetException
-
last
Description copied from interface:ISqlJetBtreeTableGo to last record.- Specified by:
lastin interfaceISqlJetBtreeTable- Returns:
- true if there is at least one record.
- Throws:
SqlJetException
-
next
Description copied from interface:ISqlJetBtreeTableGo to next record.- Specified by:
nextin 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:ISqlJetBtreeTableGo to previous record.- Specified by:
previousin interfaceISqlJetBtreeTable- Returns:
- true if there is at least one record and begin of cursor is not reached yet
- Throws:
SqlJetException
-
getRecord
- Specified by:
getRecordin interfaceISqlJetBtreeTable- Returns:
- Throws:
SqlJetException
-
lockTable
public void lockTable(boolean write) - Specified by:
lockTablein interfaceISqlJetBtreeTable- Parameters:
write-
-
getEncoding
- Specified by:
getEncodingin interfaceISqlJetBtreeTable- Returns:
- Throws:
SqlJetException
-
checkField
- Throws:
SqlJetException
-
getValueMem
- Throws:
SqlJetException
-
getValue
Description copied from interface:ISqlJetBtreeTableGet value as object.- Specified by:
getValuein interfaceISqlJetBtreeTable- Parameters:
field-- Returns:
- Throws:
SqlJetException
-
getValueUncached
- Throws:
SqlJetException
-
getFieldsCount
Description copied from interface:ISqlJetBtreeTableGet count of fields in current record.- Specified by:
getFieldsCountin interfaceISqlJetBtreeTable- Returns:
- count of fields
- Throws:
SqlJetException
-
isNull
Description copied from interface:ISqlJetBtreeTableCheck to field has null value.- Specified by:
isNullin interfaceISqlJetBtreeTable- Parameters:
field- number of field begin from zero- Returns:
- true if field value is null
- Throws:
SqlJetException
-
getString
Description copied from interface:ISqlJetBtreeTableGet field's value as string.- Specified by:
getStringin interfaceISqlJetBtreeTable- Parameters:
field- number of field begin from zero- Returns:
- field's value as string
- Throws:
SqlJetException
-
getInteger
Description copied from interface:ISqlJetBtreeTableGet field's value as integer.- Specified by:
getIntegerin interfaceISqlJetBtreeTable- Parameters:
field- number of field begin from zero- Returns:
- field's value as integer
- Throws:
SqlJetException
-
getFloat
Description copied from interface:ISqlJetBtreeTableGet field's value as real (float).- Specified by:
getFloatin interfaceISqlJetBtreeTable- Parameters:
field- number of field begin from zero- Returns:
- field's value as real
- Throws:
SqlJetException
-
getFieldType
Description copied from interface:ISqlJetBtreeTableGet type of field.- Specified by:
getFieldTypein interfaceISqlJetBtreeTable- Parameters:
field- number of field begin from zero- Returns:
- type of field
- Throws:
SqlJetException
-
getBlob
Description copied from interface:ISqlJetBtreeTableGet field's value as BLOB.- Specified by:
getBlobin interfaceISqlJetBtreeTable- Parameters:
field- number of field begin from zero- Returns:
- field's value as BLOB
- Throws:
SqlJetException
-
getValues
Description copied from interface:ISqlJetBtreeTableGet values as objects.- Specified by:
getValuesin interfaceISqlJetBtreeTable- Returns:
- Throws:
SqlJetException
-
newRowId
- Specified by:
newRowIdin 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:
newRowIdin interfaceISqlJetBtreeTable- Parameters:
prev-- Returns:
- Throws:
SqlJetException
-
clearRecordCache
protected void clearRecordCache() -
clear
- Specified by:
clearin interfaceISqlJetBtreeTable- Throws:
SqlJetException
-
getKeySize
- Specified by:
getKeySizein interfaceISqlJetBtreeTable- Returns:
- Throws:
SqlJetException
-
moveTo
- Specified by:
moveToin interfaceISqlJetBtreeTable- Parameters:
pKey-nKey-bias-- Returns:
- Throws:
SqlJetException
-
insert
public void insert(ISqlJetMemoryPointer pKey, long nKey, ISqlJetMemoryPointer pData, int nData, int nZero, boolean bias) throws SqlJetException - Specified by:
insertin interfaceISqlJetBtreeTable- Parameters:
pKey-nKey-pData-nData-nZero-bias-object-rowId-remaining-i-b-- Throws:
SqlJetException
-
delete
- Specified by:
deletein interfaceISqlJetBtreeTable- Throws:
SqlJetException
-