* @see org.tmatesoft.sqljet.core.table.ISqlJetTable#scope(java.lang.String,
* java.lang.Object[], java.lang.Object[])
*/
public ISqlJetCursor scope(final String indexName, SqlJetScope scope) throws SqlJetException {
final SqlJetScope adjustedScope = SqlJetUtility.adjustScopeNumberTypes(scope);
return (ISqlJetCursor) db.runWithLock(new ISqlJetRunnableWithLock() {
public Object runWithLock(SqlJetDb db) throws SqlJetException {
final SqlJetBtreeDataTable table = new SqlJetBtreeDataTable(btree, tableName, write);
checkIndexName(indexName, table);
if (isNeedReverse(getIndexTable(indexName, table), adjustedScope)) {
return new SqlJetReverseOrderCursor(new SqlJetIndexScopeCursor(table, db, indexName, adjustedScope.reverse()));