org.axiondb

Interface Table

public interface Table extends RowSource

A database table.

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

Author: Chuck Burdick Rodney Waldhoff Ahimanikya Satapathy

Field Summary
static StringREGULAR_TABLE_TYPE
static StringSYSTEM_TABLE_TYPE
Method Summary
voidaddColumn(Column col)
Add the given Columnto this table.
voidaddConstraint(Constraint constraint)
voidaddIndex(Index index)
Add an index, associating it with a Column, and adding it as a org.axiondb.TableModificationListenerto the table.
voidaddRow(Row row)
Insert the given Row.
voidaddTableModificationListener(TableModificationListener listener)
Adds a listener to receive events on this table
voidapplyDeletes(IntCollection rowids)
Remove the specified rows from this table and any associated indices.
voidapplyInserts(RowCollection rows)
Insert the given rows into this table and any associated indices.
voidapplyUpdates(RowCollection rows)
Update the given rows in this table and any associated indices.
voidcheckpoint()
voiddeleteRow(Row row)
Delete the given Row.
voiddrop()
Drop this table from the database.
voidfreeRowId(int id)
Un-reserve a row id.
ColumngetColumn(int index)
Return the Columncorresponding to the given zero-based index .
ColumngetColumn(String name)
Return the Columnfor the given name .
intgetColumnCount()
Return the number of Columns I contain.
ListgetColumnIdentifiers()
Return an readonly Listover the ColumnIdentifiersfor my Columns.
intgetColumnIndex(String name)
Return the zero-based index of the Columnwith the given name .
ConstraintgetConstraint(String name)
IteratorgetConstraints()
RowIteratorgetIndexedRows(Selectable where, boolean readOnly)
RowIteratorgetIndexedRows(RowSource source, Selectable where, boolean readOnly)
IndexgetIndexForColumn(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.
RowIteratorgetMatchingRows(List selectables, List values, boolean readOnly)
Obtain an iteratorover my Rows where each Selectablein the selectable List list evaluatesto the corresponding value in the value List list.
StringgetName()
Get the name of this table.
intgetNextRowId()
Reserve a row id.
intgetRowCount()
Return the number of Rows I contain.
RowIteratorgetRowIterator(boolean readOnly)
Obtain an iteratorover my Rows.
SequencegetSequence()
Iterator<TableModificationListener>getTableModificationListeners()
StringgetType()
Get the type of this table.
booleanhasColumn(ColumnIdentifier id)
Indicate whether the ColumnIdentifierreferences a column in this table
booleanhasIndex(String name)
booleanisColumnIndexed(Column column)
Check to see if an Indexexists for the given Column
booleanisPrimaryKeyConstraintExists(String columnName)
check if primary constraint exists on a column
booleanisUniqueConstraintExists(String columnName)
check if unique constraint exists on a column
RowDecoratormakeRowDecorator()
TransactableTablemakeTransactableTable()
Create a TransactableTablefor this table.
voidmigrate()
Migrate from older version to newer version for this table
voidpopulateIndex(Index index)
Populate an Index, adding my current rows to it.
voidremount(File dir, boolean dataOnly)
Notify this table that its disk-location has moved.
ConstraintremoveConstraint(String name)
voidremoveIndex(Index index)
Remove an index, both from the indices and as a TableModificationListener
voidremoveTableModificationListener(TableModificationListener listener)
Removes a listener so that it stops receiving events on this table
voidrename(String oldName, String newName)
voidsetDeferAllConstraints(boolean deferAll)
voidsetSequence(Sequence seq)
voidshutdown()
The database is shutting down, shutdown this table also.
voidtruncate()
Unconditionally delete all rows in this table.
voidupdateRow(Row oldrow, Row newrow)
Update the given Row.

Field Detail

REGULAR_TABLE_TYPE

public static final String REGULAR_TABLE_TYPE

SYSTEM_TABLE_TYPE

public static final String SYSTEM_TABLE_TYPE

Method Detail

addColumn

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

addConstraint

public void addConstraint(Constraint constraint)

addIndex

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

Parameters: index

Throws: AxionException

See Also: Table Table Table Table Table

addRow

public void addRow(Row row)
Insert the given Row.

addTableModificationListener

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

applyDeletes

public void applyDeletes(IntCollection rowids)
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.

applyInserts

public void applyInserts(RowCollection rows)
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

public void applyUpdates(RowCollection rows)
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.

checkpoint

public void checkpoint()

deleteRow

public void deleteRow(Row row)
Delete the given Row.

drop

public void drop()
Drop this table from the database.

freeRowId

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

getColumn

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

getColumn

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

getColumnCount

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

getColumnIdentifiers

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

getColumnIndex

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

getConstraint

public Constraint getConstraint(String name)

getConstraints

public Iterator getConstraints()

getIndexedRows

public RowIterator getIndexedRows(Selectable where, boolean readOnly)

Parameters: readOnly when true, the caller does not expect to be able to modify (i.e., call RowIteratoror RowIteratoron) the returned RowIterator, the returned iterator may be unmodifiable.

getIndexedRows

public RowIterator getIndexedRows(RowSource source, Selectable where, boolean readOnly)

getIndexForColumn

public 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

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

getMatchingRows

public RowIterator getMatchingRows(List selectables, List values, boolean readOnly)
Obtain an iteratorover my Rows where each Selectablein the selectable List list evaluatesto the corresponding value in the value List 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.

getName

public String getName()
Get the name of this table.

getNextRowId

public int getNextRowId()
Reserve a row id.

getRowCount

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

getRowIterator

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

Parameters: readOnly when true, the caller does not expect to be able to modify (i.e., call RowIteratoror RowIteratoron) the returned RowIterator, the returned iterator may be unmodifiable.

getSequence

public Sequence getSequence()

getTableModificationListeners

public Iterator<TableModificationListener> getTableModificationListeners()

getType

public String getType()
Get the type of this table.

hasColumn

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

hasIndex

public boolean hasIndex(String name)

isColumnIndexed

public 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

public 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

public 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

public RowDecorator makeRowDecorator()

makeTransactableTable

public TransactableTable makeTransactableTable()
Create a TransactableTablefor this table.

migrate

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

populateIndex

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

Parameters: index

Throws: AxionException

See Also: Table

remount

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

removeConstraint

public Constraint removeConstraint(String name)

removeIndex

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

Parameters: index

Throws: AxionException

removeTableModificationListener

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

rename

public void rename(String oldName, String newName)

setDeferAllConstraints

public void setDeferAllConstraints(boolean deferAll)

setSequence

public void setSequence(Sequence seq)

shutdown

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

truncate

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

Returns: true if truncation succeeded; false otherwise

updateRow

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