org.axiondb.engine.indexes
Class IntBTreeIndex

java.lang.Object
  extended by org.axiondb.event.BaseTableModificationListener
      extended by org.axiondb.engine.indexes.BaseIndex
          extended by org.axiondb.engine.indexes.BaseBTreeIndex
              extended by org.axiondb.engine.indexes.IntBTreeIndex
All Implemented Interfaces:
TableModificationListener, Index

public class IntBTreeIndex
extends BaseBTreeIndex
implements TableModificationListener

A B-Tree indexover integer keys.

Version:
$Revision: 1.9 $ $Date: 2005/12/20 18:32:30 $

Field Summary
 
Fields inherited from interface org.axiondb.Index
ARRAY, BTREE, DEFAULT, TTREE
 
Constructor Summary
IntBTreeIndex(String name, Column column, boolean unique)
           
IntBTreeIndex(String name, Column column, boolean unique, File dataDirectory)
           
 
Method Summary
 void changeRowId(Table table, Row row, int oldId, int newId)
           
 IntBTree getBTree()
           
 IndexLoader getIndexLoader()
           
 RowIterator getInorderRowIterator(RowSource source)
          Returns a RowIteratorwhich is inorder traversal of keys,
 RowIterator getRowIterator(RowSource source, Function function, Object value)
          Returns a RowIteratorover the indexed rows, limited by the given ComparisonOperator/value pair, using the default sort order.
 void rowDeleted(RowEvent event)
           
 void rowInserted(RowEvent event)
           
 void rowUpdated(RowEvent event)
           
 void truncate()
           
 
Methods inherited from class org.axiondb.engine.indexes.BaseBTreeIndex
getType, save, saveAfterTruncate, supportsFunction
 
Methods inherited from class org.axiondb.engine.indexes.BaseIndex
getComparator, getDataType, getIndexedColumn, getName, isUnique
 
Methods inherited from class org.axiondb.event.BaseTableModificationListener
columnAdded, constraintAdded, constraintRemoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.axiondb.event.TableModificationListener
columnAdded, constraintAdded, constraintRemoved
 
Methods inherited from interface org.axiondb.Index
getIndexedColumn, getName, isUnique
 

Constructor Detail

IntBTreeIndex

public IntBTreeIndex(String name,
                     Column column,
                     boolean unique)
              throws AxionException
Throws:
AxionException

IntBTreeIndex

public IntBTreeIndex(String name,
                     Column column,
                     boolean unique,
                     File dataDirectory)
              throws AxionException
Throws:
AxionException
Method Detail

changeRowId

public void changeRowId(Table table,
                        Row row,
                        int oldId,
                        int newId)
                 throws AxionException
Specified by:
changeRowId in interface Index
Throws:
AxionException

getBTree

public IntBTree getBTree()

getIndexLoader

public IndexLoader getIndexLoader()
Specified by:
getIndexLoader in interface Index
Specified by:
getIndexLoader in class BaseIndex

getInorderRowIterator

public final RowIterator getInorderRowIterator(RowSource source)
                                        throws AxionException
Description copied from interface: Index
Returns a RowIteratorwhich is inorder traversal of keys,

Specified by:
getInorderRowIterator in interface Index
Specified by:
getInorderRowIterator in class BaseIndex
Parameters:
source - table/view for which we need to get inorder traversal
Returns:
Throws:
AxionException

getRowIterator

public RowIterator getRowIterator(RowSource source,
                                  Function function,
                                  Object value)
                           throws AxionException
Description copied from interface: Index
Returns a RowIteratorover the indexed rows, limited by the given ComparisonOperator/value pair, using the default sort order.

Specified by:
getRowIterator in interface Index
Specified by:
getRowIterator in class BaseIndex
value - the value to compare the indexed column to
Throws:
AxionException

rowDeleted

public void rowDeleted(RowEvent event)
                throws AxionException
Specified by:
rowDeleted in interface TableModificationListener
Overrides:
rowDeleted in class BaseTableModificationListener
Throws:
AxionException

rowInserted

public void rowInserted(RowEvent event)
                 throws AxionException
Specified by:
rowInserted in interface TableModificationListener
Overrides:
rowInserted in class BaseTableModificationListener
Throws:
AxionException

rowUpdated

public void rowUpdated(RowEvent event)
                throws AxionException
Specified by:
rowUpdated in interface TableModificationListener
Overrides:
rowUpdated in class BaseTableModificationListener
Throws:
AxionException

truncate

public void truncate()
              throws AxionException
Specified by:
truncate in interface Index
Specified by:
truncate in class BaseIndex
Throws:
AxionException