org.axiondb
Interface Table

All Superinterfaces:
RowSource
All Known Subinterfaces:
ExternalTable, TransactableTable
All Known Implementing Classes:
AbstractBaseTable, BaseDiskTable, BaseFlatfileTable, BaseTable, DelimitedFlatfileTable, DiskTable, ExternalAxionDBTable, ExternalDatabaseTable, FixedWidthFlatfileTable, MemoryTable, TableView, TaggedEBCDICTable, TransactableTableImpl

public interface Table
extends RowSource

A database table.

Version:
$Revision: 1.61 $ $Date: 2007/11/13 19:04:02 $

Field Summary
static String REGULAR_TABLE_TYPE
           
static String SYSTEM_TABLE_TYPE
           
 
Method Summary
 void addColumn(Column col)
          Add the given Columnto this table.
 void addConstraint(Constraint constraint)
           
 void addIndex(Index index)
          Add an index, associating it with a Column, and adding it as a org.axiondb.TableModificationListenerto the table.
 void addRow(Row row)
          Insert the given Row.
 void addTableModificationListener(TableModificationListener listener)
          Adds a listener to receive events on this table
 void applyDeletes(org.apache.commons.collections.primitives.IntCollection rowids)
          Remove the specified rows from this table and any associated indices.
 void applyInserts(RowCollection rows)
          Insert the given rows into this table and any associated indices.
 void applyUpdates(RowCollection rows)
          Update the given rows in this table and any associated indices.
 void checkpoint()
           
 void deleteRow(Row row)
          Delete the given Row.
 void drop()
          Drop this table from the database.
 void freeRowId(int id)
          Un-reserve a row id.
 Column getColumn(int index)
          Return the Columncorresponding to the given zero-based index .
 Column getColumn(String name)
          Return the Columnfor the given name .
 int getColumnCount()
          Return the number of Columns I contain.
 List getColumnIdentifiers()
          Return an readonly Listover the ColumnIdentifiersfor my Columns.
 int getColumnIndex(String name)
          Return the zero-based index of the Columnwith the given name .
 Constraint getConstraint(String name)
           
 Iterator getConstraints()
           
 RowIterator getIndexedRows(RowSource source, Selectable where, boolean readOnly)
           
 RowIterator getIndexedRows(Selectable where, boolean readOnly)
           
 Index getIndexForColumn(Column column)
          Return the first Indexthat pertains to the given Column, or null if no such Indexexists.
 Iterator<Index> getIndices()
          Obtain an Iteratorover my indices.
 RowIterator getMatchingRows(List selectables, List values, boolean readOnly)
          Obtain an iteratorover my Rows where each Selectablein the selectable list evaluatesto the corresponding value in the value list.
 String getName()
          Get the name of this table.
 int getNextRowId()
          Reserve a row id.
 int getRowCount()
          Return the number of Rows I contain.
 RowIterator getRowIterator(boolean readOnly)
          Obtain an iteratorover my Rows.
 Sequence getSequence()
           
 Iterator<TableModificationListener> getTableModificationListeners()
           
 String getType()
          Get the type of this table.
 boolean hasColumn(ColumnIdentifier id)
          Indicate whether the ColumnIdentifierreferences a column in this table
 boolean hasIndex(String name)
           
 boolean isColumnIndexed(Column column)
          Check to see if an Indexexists for the given Column
 boolean isPrimaryKeyConstraintExists(String columnName)
          check if primary constraint exists on a column
 boolean isUniqueConstraintExists(String columnName)
          check if unique constraint exists on a column
 RowDecorator makeRowDecorator()
           
 TransactableTable makeTransactableTable()
          Create a TransactableTablefor this table.
 void migrate()
          Migrate from older version to newer version for this table
 void populateIndex(Index index)
          Populate an Index, adding my current rows to it.
 void remount(File dir, boolean dataOnly)
          Notify this table that its disk-location has moved.
 Constraint removeConstraint(String name)
           
 void removeIndex(Index index)
          Remove an index, both from the indices and as a TableModificationListener
 void removeTableModificationListener(TableModificationListener listener)
          Removes a listener so that it stops receiving events on this table
 void rename(String oldName, String newName)
           
 void setDeferAllConstraints(boolean deferAll)
           
 void setSequence(Sequence seq)
           
 void shutdown()
          The database is shutting down, shutdown this table also.
 void truncate()
          Unconditionally delete all rows in this table.
 void updateRow(Row oldrow, Row newrow)
          Update the given Row.
 
Methods inherited from interface org.axiondb.RowSource
getRow
 

Field Detail

REGULAR_TABLE_TYPE

static final String REGULAR_TABLE_TYPE
See Also:
Constant Field Values

SYSTEM_TABLE_TYPE

static final String SYSTEM_TABLE_TYPE
See Also:
Constant Field Values
Method Detail

addColumn

void addColumn(Column col)
               throws AxionException
Add the given Columnto this table.

Throws:
AxionException

addConstraint

void addConstraint(Constraint constraint)
                   throws AxionException
Throws:
AxionException

addIndex

void addIndex(Index index)
              throws AxionException
Add an index, associating it with a Column, and adding it as a org.axiondb.TableModificationListenerto the table.

Parameters:
index -
Throws:
AxionException
See Also:
addIndex(org.axiondb.Index), addTableModificationListener(org.axiondb.event.TableModificationListener), getIndexForColumn(org.axiondb.Column), isColumnIndexed(org.axiondb.Column), populateIndex(org.axiondb.Index)

addRow

void addRow(Row row)
            throws AxionException
Insert the given Row.

Throws:
AxionException

addTableModificationListener

void addTableModificationListener(TableModificationListener listener)
Adds a listener to receive events on this table


getTableModificationListeners

Iterator<TableModificationListener> getTableModificationListeners()

applyDeletes

void applyDeletes(org.apache.commons.collections.primitives.IntCollection rowids)
                  throws AxionException
Remove the specified rows from this table and any associated indices. This process is allowed to be destructive, the table my delete values from the given list.

Throws:
AxionException

applyInserts

void applyInserts(RowCollection rows)
                  throws AxionException
Insert the given rows into this table and any associated indices. This process is allowed to be destructive, the table my delete rows from the given list.

Parameters:
rows - a collection of Rows
Throws:
AxionException

applyUpdates

void applyUpdates(RowCollection rows)
                  throws AxionException
Update the given rows in this table and any associated indices. This process is allowed to be destructive, the table my delete rows from the given list.

Throws:
AxionException

drop

void drop()
          throws AxionException
Drop this table from the database.

Throws:
AxionException

freeRowId

void freeRowId(int id)
Un-reserve a row id.


getColumn

Column getColumn(int index)
Return the Columncorresponding to the given zero-based index .


getColumn

Column getColumn(String name)
Return the Columnfor the given name .


getColumnCount

int getColumnCount()
Return the number of Columns I contain.

Specified by:
getColumnCount in interface RowSource

getColumnIdentifiers

List getColumnIdentifiers()
Return an readonly Listover the ColumnIdentifiersfor my Columns.


getColumnIndex

int getColumnIndex(String name)
                   throws AxionException
Return the zero-based index of the Columnwith the given name .

Specified by:
getColumnIndex in interface RowSource
Throws:
AxionException

getConstraints

Iterator getConstraints()

getIndexedRows

RowIterator getIndexedRows(Selectable where,
                           boolean readOnly)
                           throws AxionException
Parameters:
readOnly - when true, the caller does not expect to be able to modify (i.e., call RowIterator.set(org.axiondb.Row)or RowIterator.remove()on) the returned RowIterator, the returned iterator may be unmodifiable.
Throws:
AxionException

getIndexedRows

RowIterator getIndexedRows(RowSource source,
                           Selectable where,
                           boolean readOnly)
                           throws AxionException
Throws:
AxionException

getIndexForColumn

Index getIndexForColumn(Column column)
Return the first Indexthat pertains to the given Column, or null if no such Indexexists.

Returns:
the pertinent Column, or null if no such Indexexists

getIndices

Iterator<Index> getIndices()
Obtain an Iteratorover my indices.


getMatchingRows

RowIterator getMatchingRows(List selectables,
                            List values,
                            boolean readOnly)
                            throws AxionException
Obtain an iteratorover my Rows where each Selectablein the selectable list evaluatesto the corresponding value in the value list.

This is functionally similiar to executing a SELECT over this table where selectable[i] = value[i] for each value of i . The return RowIterator is not modifiable.

Throws:
AxionException

getName

String getName()
Get the name of this table.


getNextRowId

int getNextRowId()
Reserve a row id.


getRowCount

int getRowCount()
Return the number of Rows I contain.


getRowIterator

RowIterator getRowIterator(boolean readOnly)
                           throws AxionException
Obtain an iteratorover my Rows.

Parameters:
readOnly - when true, the caller does not expect to be able to modify (i.e., call RowIterator.set(org.axiondb.Row)or RowIterator.remove()on) the returned RowIterator, the returned iterator may be unmodifiable.
Throws:
AxionException

getType

String getType()
Get the type of this table.


hasColumn

boolean hasColumn(ColumnIdentifier id)
Indicate whether the ColumnIdentifierreferences a column in this table


hasIndex

boolean hasIndex(String name)
                 throws AxionException
Throws:
AxionException

isColumnIndexed

boolean isColumnIndexed(Column column)
Check to see if an Indexexists for the given Column

Parameters:
column - Columnto check
Returns:
true iff there is an existing Indexfor the given Column

isPrimaryKeyConstraintExists

boolean isPrimaryKeyConstraintExists(String columnName)
check if primary constraint exists on a column

Parameters:
ColumnName - name of the column
Returns:
if PrimaryKeyConstraint exists on the column

isUniqueConstraintExists

boolean isUniqueConstraintExists(String columnName)
check if unique constraint exists on a column

Parameters:
columnName - name of the columm
Returns:
true if uniqueConstraint exists on the column

makeRowDecorator

RowDecorator makeRowDecorator()
Specified by:
makeRowDecorator in interface RowSource

makeTransactableTable

TransactableTable makeTransactableTable()
Create a TransactableTablefor this table.


migrate

void migrate()
             throws AxionException
Migrate from older version to newer version for this table

Throws:
AxionException

populateIndex

void populateIndex(Index index)
                   throws AxionException
Populate an Index, adding my current rows to it. Does not addthe index.

Parameters:
index -
Throws:
AxionException
See Also:
addIndex(org.axiondb.Index)

remount

void remount(File dir,
             boolean dataOnly)
             throws AxionException
Notify this table that its disk-location has moved.

Throws:
AxionException

removeConstraint

Constraint removeConstraint(String name)

getConstraint

Constraint getConstraint(String name)

removeIndex

void removeIndex(Index index)
                 throws AxionException
Remove an index, both from the indices and as a TableModificationListener

Parameters:
index -
Throws:
AxionException

removeTableModificationListener

void removeTableModificationListener(TableModificationListener listener)
Removes a listener so that it stops receiving events on this table


rename

void rename(String oldName,
            String newName)
            throws AxionException
Throws:
AxionException

shutdown

void shutdown()
              throws AxionException
The database is shutting down, shutdown this table also.

Throws:
AxionException

truncate

void truncate()
              throws AxionException
Unconditionally delete all rows in this table.

Throws:
AxionException

updateRow

void updateRow(Row oldrow,
               Row newrow)
               throws AxionException
Update the given Row.

Throws:
AxionException

deleteRow

void deleteRow(Row row)
               throws AxionException
Delete the given Row.

Throws:
AxionException

checkpoint

void checkpoint()
                throws AxionException
Throws:
AxionException

setSequence

void setSequence(Sequence seq)
                 throws AxionException
Throws:
AxionException

getSequence

Sequence getSequence()

setDeferAllConstraints

void setDeferAllConstraints(boolean deferAll)