org.axiondb
Interface Index

All Superinterfaces:
TableModificationListener
All Known Implementing Classes:
BaseArrayIndex, BaseBTreeIndex, BaseIndex

public interface Index
extends TableModificationListener

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

Version:
$Revision: 1.20 $ $Date: 2004/08/31 02:34:40 $

Field Summary
static String ARRAY
           
static String BTREE
           
static String DEFAULT
           
 
Method Summary
 void changeRowId(Table table, Row row, int oldId, int newId)
           
 Column getIndexedColumn()
          Returns the column I index.
 IndexLoader getIndexLoader()
           
 RowIterator getInorderRowIterator(RowSource source)
          Returns a RowIteratorwhich is inorder traversal of keys,
 String getName()
          Returns my name.
 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.
 String getType()
          Returns my type.
 boolean isUnique()
          Whether or not I allow duplicate values.
 void save(File dataDirectory)
           
 void saveAfterTruncate(File dataDirectory)
           
 boolean supportsFunction(Function fn)
          Returns true iff #getRowIterator(org.axiondb.RowSource,org.axiondb.ComparisonOperator,java.lang.Object) can support the given operator, false otherwise.
 void truncate()
           
 
Methods inherited from interface org.axiondb.event.TableModificationListener
columnAdded, constraintAdded, constraintRemoved, rowDeleted, rowInserted, rowUpdated
 

Field Detail

BTREE

public static final String BTREE
See Also:
Constant Field Values

ARRAY

public static final String ARRAY
See Also:
Constant Field Values

DEFAULT

public static final String DEFAULT
See Also:
Constant Field Values
Method Detail

changeRowId

public void changeRowId(Table table,
                        Row row,
                        int oldId,
                        int newId)
                 throws AxionException
Throws:
AxionException

getIndexedColumn

public Column getIndexedColumn()
Returns the column I index.


getIndexLoader

public IndexLoader getIndexLoader()

getInorderRowIterator

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

Parameters:
source - table/view for which we need to get inorder traversal
Returns:
@throws AxionException
Throws:
AxionException

getName

public String getName()
Returns my name.


getType

public String getType()
Returns my type.


getRowIterator

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

Parameters:
value - the value to compare the indexed column to
Throws:
AxionException

isUnique

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


save

public void save(File dataDirectory)
          throws AxionException
Throws:
AxionException

saveAfterTruncate

public void saveAfterTruncate(File dataDirectory)
                       throws AxionException
Throws:
AxionException

supportsFunction

public boolean supportsFunction(Function fn)
Returns true iff #getRowIterator(org.axiondb.RowSource,org.axiondb.ComparisonOperator,java.lang.Object) can support the given operator, false otherwise.


truncate

public void truncate()
              throws AxionException
Throws:
AxionException