Class SqlJetBtreeIndexTable
- java.lang.Object
-
- org.tmatesoft.sqljet.core.internal.table.SqlJetBtreeTable
-
- org.tmatesoft.sqljet.core.internal.table.SqlJetBtreeIndexTable
-
- All Implemented Interfaces:
ISqlJetBtreeIndexTable
,ISqlJetBtreeTable
public class SqlJetBtreeIndexTable extends SqlJetBtreeTable implements ISqlJetBtreeIndexTable
- Author:
- TMate Software Ltd., Sergey Scherbina (sergey.scherbina@gmail.com)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.tmatesoft.sqljet.core.internal.table.SqlJetBtreeTable
SqlJetBtreeTable.State
-
-
Field Summary
-
Fields inherited from class org.tmatesoft.sqljet.core.internal.table.SqlJetBtreeTable
btree, index, rootPage, write
-
-
Constructor Summary
Constructors Constructor Description SqlJetBtreeIndexTable(ISqlJetBtree btree, java.lang.String indexName, boolean write)
Open index by nameSqlJetBtreeIndexTable(ISqlJetBtree btree, java.lang.String indexName, java.util.List<java.lang.String> columns, boolean write)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
adjustKeyInfo()
boolean
checkKey(java.lang.Object... key)
Check current record against key.int
compareKey(java.lang.Object[] key)
int
compareKeys(java.lang.Object[] firstKey, java.lang.Object[] lastKey)
boolean
delete(long rowId, java.lang.Object... key)
Delete entry which matches to key and point to given rowId.ISqlJetIndexDef
getIndexDef()
long
getKeyRowId()
void
insert(long rowId, boolean append, java.lang.Object... key)
Writes key into the index.long
lookup(boolean next, java.lang.Object... values)
Lookup index entry by key values.long
lookupLastNear(java.lang.Object[] key)
long
lookupNear(boolean next, java.lang.Object[] key)
void
reindex(ISqlJetSchema schema)
-
Methods inherited from class org.tmatesoft.sqljet.core.internal.table.SqlJetBtreeTable
checkField, clear, clearRecordCache, close, delete, eof, first, getBlob, getCursor, getEncoding, getFieldsCount, getFieldType, getFloat, getInteger, getKeyInfo, getKeySize, getRecord, getString, getValue, getValueMem, getValues, getValueUncached, hasMoved, insert, isNull, last, lock, lockTable, moveTo, newRowId, newRowId, next, popState, previous, pushState, unlock
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.tmatesoft.sqljet.core.internal.table.ISqlJetBtreeTable
clear, close, delete, eof, first, getBlob, getEncoding, getFieldsCount, getFieldType, getFloat, getInteger, getKeySize, getRecord, getString, getValue, getValues, hasMoved, insert, isNull, last, lock, lockTable, moveTo, newRowId, newRowId, next, popState, previous, pushState, unlock
-
-
-
-
Constructor Detail
-
SqlJetBtreeIndexTable
public SqlJetBtreeIndexTable(ISqlJetBtree btree, java.lang.String indexName, boolean write) throws SqlJetException
Open index by name- Throws:
SqlJetException
-
SqlJetBtreeIndexTable
public SqlJetBtreeIndexTable(ISqlJetBtree btree, java.lang.String indexName, java.util.List<java.lang.String> columns, boolean write) throws SqlJetException
- Throws:
SqlJetException
-
-
Method Detail
-
getIndexDef
public ISqlJetIndexDef getIndexDef()
- Returns:
- the indexDef
-
lookup
public long lookup(boolean next, java.lang.Object... values) throws SqlJetException
Description copied from interface:ISqlJetBtreeIndexTable
Lookup index entry by key values. If 'next' is true then just check next entry in index.- Specified by:
lookup
in interfaceISqlJetBtreeIndexTable
- Parameters:
next
- just check next index entryvalues
- the key values- Returns:
- Throws:
SqlJetException
-
compareKeys
public int compareKeys(java.lang.Object[] firstKey, java.lang.Object[] lastKey) throws SqlJetException
- Specified by:
compareKeys
in interfaceISqlJetBtreeIndexTable
- Returns:
- Throws:
SqlJetException
-
checkKey
public boolean checkKey(java.lang.Object... key) throws SqlJetException
Description copied from interface:ISqlJetBtreeIndexTable
Check current record against key.- Specified by:
checkKey
in interfaceISqlJetBtreeIndexTable
- Returns:
- Throws:
SqlJetException
-
adjustKeyInfo
protected void adjustKeyInfo() throws SqlJetException
- Overrides:
adjustKeyInfo
in classSqlJetBtreeTable
- Parameters:
key
-- Throws:
SqlJetException
-
insert
public void insert(long rowId, boolean append, java.lang.Object... key) throws SqlJetException
Description copied from interface:ISqlJetBtreeIndexTable
Writes key into the index. Data for the entry is nil. Append flag that provides a hint to the b-tree layer that this insert is likely to be an append.- Specified by:
insert
in interfaceISqlJetBtreeIndexTable
- Throws:
SqlJetException
-
delete
public boolean delete(long rowId, java.lang.Object... key) throws SqlJetException
Description copied from interface:ISqlJetBtreeIndexTable
Delete entry which matches to key and point to given rowId.- Specified by:
delete
in interfaceISqlJetBtreeIndexTable
- Returns:
- true if there was deleted entry which matches to key.
- Throws:
SqlJetException
-
getKeyRowId
public long getKeyRowId() throws SqlJetException
- Specified by:
getKeyRowId
in interfaceISqlJetBtreeIndexTable
- Throws:
SqlJetException
-
reindex
public void reindex(ISqlJetSchema schema) throws SqlJetException
- Throws:
SqlJetException
-
compareKey
public int compareKey(java.lang.Object[] key) throws SqlJetException
- Specified by:
compareKey
in interfaceISqlJetBtreeIndexTable
- Returns:
- Throws:
SqlJetException
-
lookupNear
public long lookupNear(boolean next, java.lang.Object[] key) throws SqlJetException
- Specified by:
lookupNear
in interfaceISqlJetBtreeIndexTable
- Returns:
- Throws:
SqlJetException
-
lookupLastNear
public long lookupLastNear(java.lang.Object[] key) throws SqlJetException
- Specified by:
lookupLastNear
in interfaceISqlJetBtreeIndexTable
- Returns:
- Throws:
SqlJetException
-
-