| java.lang.Object org.hsqldb.Index
Index | public class Index (Code) | | Implementation of an AVL tree with parent pointers in nodes. Subclasses
of Node implement the tree node objects for memory or disk storage. An
Index has a root Node that is linked with other nodes using Java Object
references or file pointers, depending on Node implementation.
An Index object also holds information on table columns (in the form of int
indexes) that are covered by it.(fredt@users)
author: Thomas Mueller (Hypersonic SQL Group) version: 1.8.0 since: Hypersonic SQL |
Inner Class :static class IndexRowIterator implements RowIterator | |
Constructor Summary | |
| Index(Database database, HsqlName name, Table table, int[] column, int[] colTypes, boolean isPk, boolean unique, boolean constraint, boolean forward, int[] pkcols, int[] pktypes, boolean temp) |
Method Summary | |
void | clearAll(Session session) | void | clearIterators() | int | compareRowNonUnique(Session session, Object[] a, int[] rowColMap, Object[] b) Compares two table rows based on the columns of this index. | static int | compareRows(Session session, Object[] a, Object[] b, int[] cols, int[] coltypes) | void | delete(Session session, Node x) | RowIterator | emptyIterator() | boolean | exists(Session session, Object[] rowdata, int[] rowColMap) | RowIterator | findFirstRow(Session session, Object[] rowdata, int[] rowColMap) | RowIterator | findFirstRow(Session session, Object[] rowdata) Return the first node equal to the rowdata object. | RowIterator | findFirstRow(Session session, Object value, int compare) Finds the first node that is larger or equal to the given one based
on the first column of the index only. | RowIterator | findFirstRowForDelete(Session session, Object[] rowdata, int[] rowColMap) | RowIterator | findFirstRowNotNull(Session session) Finds the first node where the data is not null. | Row | findRow(Session session, Row row) | RowIterator | firstRow(Session session) | String | getColumnNameList() | int[] | getColumnTypes() | int[] | getColumns() | int | getIndexOrderValue() Returns a value indicating the order of different types of index in
the list of indexes for a table. | HsqlName | getName() | int | getRoot() | int | getVisibleColumns() | void | insert(Session session, Row row, int offset) | boolean | isConstraint() | boolean | isEmpty(Session session) | static boolean | isNull(Object[] row, int[] rowColMap) Determines if a table row has a null column for any of the columns given
in the rowColMap array. | boolean | isNull(Object[] row) Determines if a table row has a null column for any of the indexed
columns. | boolean | isUnique() | Row | lastRow(Session session) | Node | next(Node x) | void | setName(String name, boolean isquoted) Changes index name. | void | setRoot(Session session, Node node) | int | size(Session session) Returns the node count. | public int | sizeEstimate() |
DISK_INDEX | final static int DISK_INDEX(Code) | | |
MEMORY_INDEX | final static int MEMORY_INDEX(Code) | | |
POINTER_INDEX | final static int POINTER_INDEX(Code) | | |
colCheck | final boolean[] colCheck(Code) | | |
emptyIterator | static IndexRowIterator emptyIterator(Code) | | |
isConstraint | final boolean isConstraint(Code) | | |
isForward | final boolean isForward(Code) | | |
isTemp | final boolean isTemp(Code) | | |
onCommitPreserve | final boolean onCommitPreserve(Code) | | |
pkCols | final int[] pkCols(Code) | | |
pkTypes | final int[] pkTypes(Code) | | |
updatableIterators | IndexRowIterator updatableIterators(Code) | | |
Index | Index(Database database, HsqlName name, Table table, int[] column, int[] colTypes, boolean isPk, boolean unique, boolean constraint, boolean forward, int[] pkcols, int[] pktypes, boolean temp)(Code) | | Constructor declaration
Parameters: name - HsqlName of the index Parameters: table - table of the index Parameters: column - array of column indexes Parameters: type - array of column types Parameters: unique - is this a unique index Parameters: constraint - does this index belonging to a constraint Parameters: forward - is this an auto-index for an FK that refers to a table defined after this table Parameters: visColumns - count of visible columns |
clearIterators | void clearIterators()(Code) | | |
compareRowNonUnique | int compareRowNonUnique(Session session, Object[] a, int[] rowColMap, Object[] b) throws HsqlException(Code) | | Compares two table rows based on the columns of this index. The rowColMap
parameter specifies which columns of the other table are to be compared
with the colIndex columns of this index. The rowColMap can cover all
or only some columns of this index.
Parameters: a - row from another table Parameters: rowColMap - column indexes in the other table Parameters: b - a full row in this table comparison result, -1,0,+1 throws: HsqlException - |
compareRows | static int compareRows(Session session, Object[] a, Object[] b, int[] cols, int[] coltypes) throws HsqlException(Code) | | compares two full table rows based on a set of columns
Parameters: a - a full row Parameters: b - a full row Parameters: cols - array of column indexes to compare comparison result, -1,0,+1 throws: HsqlException - |
findFirstRow | RowIterator findFirstRow(Session session, Object[] rowdata) throws HsqlException(Code) | | Return the first node equal to the rowdata object. Use visible columns
only. The rowdata has the same column mapping as this table.
Parameters: rowdata - array containing table row data iterator throws: HsqlException - |
findFirstRow | RowIterator findFirstRow(Session session, Object value, int compare) throws HsqlException(Code) | | Finds the first node that is larger or equal to the given one based
on the first column of the index only.
Parameters: value - value to match Parameters: compare - comparison Expression type iterator throws: HsqlException - |
getColumnTypes | int[] getColumnTypes()(Code) | | Returns the array containing column indexes for index
|
getColumns | int[] getColumns()(Code) | | Returns the array containing column indexes for index
|
getIndexOrderValue | int getIndexOrderValue()(Code) | | Returns a value indicating the order of different types of index in
the list of indexes for a table. The position of the groups of Indexes
in the list in ascending order is as follows:
primary key index
unique constraint indexes
autogenerated foreign key indexes for FK's that reference this table or
tables created before this table
user created indexes (CREATE INDEX)
autogenerated foreign key indexes for FK's that reference tables created
after this table
Among a group of indexes, the order is based on the order of creation
of the index.
ordinal value |
getName | HsqlName getName()(Code) | | Returns the HsqlName object
|
getVisibleColumns | int getVisibleColumns()(Code) | | Returns the count of visible columns used
|
isConstraint | boolean isConstraint()(Code) | | Does this index belong to a constraint?
|
isNull | static boolean isNull(Object[] row, int[] rowColMap)(Code) | | Determines if a table row has a null column for any of the columns given
in the rowColMap array.
|
isNull | boolean isNull(Object[] row)(Code) | | Determines if a table row has a null column for any of the indexed
columns.
|
isUnique | boolean isUnique()(Code) | | Is this a UNIQUE index?
|
setName | void setName(String name, boolean isquoted) throws HsqlException(Code) | | Changes index name. Used by 'alter index rename to'. Argument isquoted
is true if the name was quoted in the DDL.
|
|
|