org.h2gis.drivers.file_table
Class H2TableIndex

java.lang.Object
  extended by org.h2.engine.DbObjectBase
      extended by org.h2.schema.SchemaObjectBase
          extended by org.h2.index.BaseIndex
              extended by org.h2gis.drivers.file_table.H2TableIndex
All Implemented Interfaces:
org.h2.engine.DbObject, org.h2.index.Index, org.h2.schema.SchemaObject

public class H2TableIndex
extends org.h2.index.BaseIndex

ScanIndex of FileDriver, the key is the row index [1-n].

Author:
Nicolas Fortin

Field Summary
static String PK_COLUMN_NAME
           
 
Fields inherited from class org.h2.index.BaseIndex
columnIds, columns, indexColumns, indexType, isMultiVersion, table
 
Fields inherited from class org.h2.engine.DbObjectBase
comment, database, trace
 
Fields inherited from interface org.h2.engine.DbObject
AGGREGATE, COMMENT, CONSTANT, CONSTRAINT, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, TABLE_OR_VIEW, TRIGGER, USER, USER_DATATYPE
 
Constructor Summary
H2TableIndex(FileDriver driver, org.h2.table.Table table, int id)
          Constructor for scan index.
H2TableIndex(FileDriver driver, org.h2.table.Table table, int id, org.h2.table.Column PKColumn, String indexName)
          Constructor for primary key index.
 
Method Summary
 void add(org.h2.engine.Session session, org.h2.result.Row row)
           
 boolean canGetFirstOrLast()
           
 boolean canScan()
           
 void checkRename()
           
 void close(org.h2.engine.Session session)
           
 org.h2.index.Cursor find(org.h2.engine.Session session, org.h2.result.SearchRow first, org.h2.result.SearchRow last)
           
 org.h2.index.Cursor findFirstOrLast(org.h2.engine.Session session, boolean first)
           
 double getCost(org.h2.engine.Session session, int[] masks, org.h2.table.TableFilter filter, org.h2.result.SortOrder sortOrder)
           
 long getDiskSpaceUsed()
           
 FileDriver getDriver()
           
 org.h2.result.Row getRow(org.h2.engine.Session session, long key)
           
 long getRowCount(org.h2.engine.Session session)
           
 long getRowCountApproximation()
           
 boolean isRowIdIndex()
           
 boolean needRebuild()
           
 void remove(org.h2.engine.Session session)
           
 void remove(org.h2.engine.Session session, org.h2.result.Row row)
           
 void truncate(org.h2.engine.Session session)
           
 
Methods inherited from class org.h2.index.BaseIndex
canFindNext, checkIndexColumnTypes, commit, compareRows, containsNullAndAllowMultipleNull, find, findNext, getColumnIndex, getColumns, getCostRangeIndex, getCreateSQL, getCreateSQLForCopy, getDropSQL, getDuplicateKeyException, getIndexColumns, getIndexType, getPlanSQL, getTable, getType, initBaseIndex, isHidden, removeChildrenAndResources, setSortedInsertMode
 
Methods inherited from class org.h2.schema.SchemaObjectBase
getSchema, getSQL, initSchemaObjectBase
 
Methods inherited from class org.h2.engine.DbObjectBase
getChildren, getComment, getDatabase, getId, getModificationId, getName, initDbObjectBase, invalidate, isTemporary, rename, setComment, setModified, setObjectName, setTemporary, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.h2.schema.SchemaObject
getSchema
 
Methods inherited from interface org.h2.engine.DbObject
getChildren, getComment, getDatabase, getId, getName, getSQL, isTemporary, rename, setComment, setTemporary
 

Field Detail

PK_COLUMN_NAME

public static final String PK_COLUMN_NAME
See Also:
Constant Field Values
Constructor Detail

H2TableIndex

public H2TableIndex(FileDriver driver,
                    org.h2.table.Table table,
                    int id)
Constructor for scan index. Hidden column _ROWID_.

Parameters:
driver - Linked file driver
table - Linked table
id - Index identifier

H2TableIndex

public H2TableIndex(FileDriver driver,
                    org.h2.table.Table table,
                    int id,
                    org.h2.table.Column PKColumn,
                    String indexName)
Constructor for primary key index.

Parameters:
driver - Linked file driver
table - Linked table
id - Index identifier
PKColumn - Primary key column declaration
indexName - Unique index name
Method Detail

checkRename

public void checkRename()
Specified by:
checkRename in interface org.h2.engine.DbObject
Specified by:
checkRename in class org.h2.engine.DbObjectBase

getDriver

public FileDriver getDriver()

getRow

public org.h2.result.Row getRow(org.h2.engine.Session session,
                                long key)
Specified by:
getRow in interface org.h2.index.Index
Overrides:
getRow in class org.h2.index.BaseIndex

close

public void close(org.h2.engine.Session session)

add

public void add(org.h2.engine.Session session,
                org.h2.result.Row row)

remove

public void remove(org.h2.engine.Session session,
                   org.h2.result.Row row)

find

public org.h2.index.Cursor find(org.h2.engine.Session session,
                                org.h2.result.SearchRow first,
                                org.h2.result.SearchRow last)

canScan

public boolean canScan()
Specified by:
canScan in interface org.h2.index.Index
Overrides:
canScan in class org.h2.index.BaseIndex

getCost

public double getCost(org.h2.engine.Session session,
                      int[] masks,
                      org.h2.table.TableFilter filter,
                      org.h2.result.SortOrder sortOrder)

remove

public void remove(org.h2.engine.Session session)

truncate

public void truncate(org.h2.engine.Session session)

canGetFirstOrLast

public boolean canGetFirstOrLast()

findFirstOrLast

public org.h2.index.Cursor findFirstOrLast(org.h2.engine.Session session,
                                           boolean first)

needRebuild

public boolean needRebuild()

getRowCount

public long getRowCount(org.h2.engine.Session session)

getRowCountApproximation

public long getRowCountApproximation()

getDiskSpaceUsed

public long getDiskSpaceUsed()

isRowIdIndex

public boolean isRowIdIndex()
Specified by:
isRowIdIndex in interface org.h2.index.Index
Overrides:
isRowIdIndex in class org.h2.index.BaseIndex


Copyright © 2015 IRSTV CNRS-FR-2488. All Rights Reserved.