org.axiondb

Interface Index

public interface Index extends TableModificationListener

A database index. (Right now, this class assumes an Index over a single column. Multipart indices will come later.)

TODO: Support expression and/or function e.g UPPER(name)
TODO: Support for Multi column index, very useful for composite keys

Version: $Revision: 1.22 $ $Date: 2005/12/20 18:32:40 $

Author: Morgan Delagrange Rodney Waldhoff Chuck Burdick Ahimanikya Satapathy

Field Summary
static StringARRAY
static StringBTREE
static StringDEFAULT
static StringTTREE
Method Summary
voidchangeRowId(Table table, Row row, int oldId, int newId)
ColumngetIndexedColumn()
Returns the column I index.
IndexLoadergetIndexLoader()
RowIteratorgetInorderRowIterator(RowSource source)
Returns a RowIteratorwhich is inorder traversal of keys,
StringgetName()
Returns my name.
RowIteratorgetRowIterator(RowSource source, Function fn, Object value)
Returns a RowIteratorover the indexed rows, limited by the given ComparisonOperator/value pair, using the default sort order.
StringgetType()
Returns my type.
booleanisUnique()
Whether or not I allow duplicate values.
voidsave(File dataDirectory)
voidsaveAfterTruncate(File dataDirectory)
booleansupportsFunction(Function fn)
Returns true iff Index can support the given operator, false otherwise.
voidtruncate()

Field Detail

ARRAY

public static final String ARRAY

BTREE

public static final String BTREE

DEFAULT

public static final String DEFAULT

TTREE

public static final String TTREE

Method Detail

changeRowId

public void changeRowId(Table table, Row row, int oldId, int newId)

getIndexedColumn

public Column getIndexedColumn()
Returns the column I index.

getIndexLoader

public IndexLoader getIndexLoader()

getInorderRowIterator

public RowIterator getInorderRowIterator(RowSource source)
Returns a RowIteratorwhich is inorder traversal of keys,

Parameters: source table/view for which we need to get inorder traversal

Returns:

Throws: AxionException

getName

public String getName()
Returns my name.

getRowIterator

public RowIterator getRowIterator(RowSource source, Function fn, Object value)
Returns a RowIteratorover the indexed rows, limited by the given ComparisonOperator/value pair, using the default sort order.

Parameters: operator the ComparisonOperatorto apply value the value to compare the indexed column to

getType

public String getType()
Returns my type.

isUnique

public boolean isUnique()
Whether or not I allow duplicate values.

save

public void save(File dataDirectory)

saveAfterTruncate

public void saveAfterTruncate(File dataDirectory)

supportsFunction

public boolean supportsFunction(Function fn)
Returns true iff Index can support the given operator, false otherwise.

truncate

public void truncate()