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
-
-
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 voidadjustKeyInfo()booleancheckKey(java.lang.Object... key)Check current record against key.intcompareKey(java.lang.Object[] key)intcompareKeys(java.lang.Object[] firstKey, java.lang.Object[] lastKey)booleandelete(long rowId, java.lang.Object... key)Delete entry which matches to key and point to given rowId.ISqlJetIndexDefgetIndexDef()longgetKeyRowId()voidinsert(long rowId, boolean append, java.lang.Object... key)Writes key into the index.longlookup(boolean next, java.lang.Object... values)Lookup index entry by key values.longlookupLastNear(java.lang.Object[] key)longlookupNear(boolean next, java.lang.Object[] key)voidreindex(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 SqlJetExceptionDescription copied from interface:ISqlJetBtreeIndexTableLookup index entry by key values. If 'next' is true then just check next entry in index.- Specified by:
lookupin 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:
compareKeysin interfaceISqlJetBtreeIndexTable- Returns:
- Throws:
SqlJetException
-
checkKey
public boolean checkKey(java.lang.Object... key) throws SqlJetExceptionDescription copied from interface:ISqlJetBtreeIndexTableCheck current record against key.- Specified by:
checkKeyin interfaceISqlJetBtreeIndexTable- Returns:
- Throws:
SqlJetException
-
adjustKeyInfo
protected void adjustKeyInfo() throws SqlJetException- Overrides:
adjustKeyInfoin classSqlJetBtreeTable- Parameters:
key-- Throws:
SqlJetException
-
insert
public void insert(long rowId, boolean append, java.lang.Object... key) throws SqlJetExceptionDescription copied from interface:ISqlJetBtreeIndexTableWrites 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:
insertin interfaceISqlJetBtreeIndexTable- Throws:
SqlJetException
-
delete
public boolean delete(long rowId, java.lang.Object... key) throws SqlJetExceptionDescription copied from interface:ISqlJetBtreeIndexTableDelete entry which matches to key and point to given rowId.- Specified by:
deletein interfaceISqlJetBtreeIndexTable- Returns:
- true if there was deleted entry which matches to key.
- Throws:
SqlJetException
-
getKeyRowId
public long getKeyRowId() throws SqlJetException- Specified by:
getKeyRowIdin 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:
compareKeyin interfaceISqlJetBtreeIndexTable- Returns:
- Throws:
SqlJetException
-
lookupNear
public long lookupNear(boolean next, java.lang.Object[] key) throws SqlJetException- Specified by:
lookupNearin interfaceISqlJetBtreeIndexTable- Returns:
- Throws:
SqlJetException
-
lookupLastNear
public long lookupLastNear(java.lang.Object[] key) throws SqlJetException- Specified by:
lookupLastNearin interfaceISqlJetBtreeIndexTable- Returns:
- Throws:
SqlJetException
-
-