com.azalient.api.file.table
Class AbstractTable

java.lang.Object
  extended by com.azalient.api.file.record.TypeObject
      extended by com.azalient.api.file.record.ReaderUtilities
          extended by com.azalient.api.file.table.AbstractTable
All Implemented Interfaces:
ITable, ITableType, Table
Direct Known Subclasses:
AbstractTableR, AbstractTableW

public abstract class AbstractTable
extends ReaderUtilities
implements Table

A base class for a table on a page in the model file.


Method Summary
 Object[] colNameObjects()
          Return an array of all column name objects.
 void destroy()
          Called when the table is no longer required, to discard references held in the table, for example to the parent page
 int headerRows()
          The number of header rows in this table.
 Class[] keyTypes()
          The type and number of key columns in this table.
 void newPage(IPage newPage)
          Move this table to a new page
 IPage page()
          The page to which this table belongs
 String pageName()
          The name of the page on which this table is found
 PageType pageType()
           
 String tableName()
           
 String toString()
           
 
Methods inherited from class com.azalient.api.file.record.TypeObject
b, c, d, equals, equals, equalsEW, f, i, keyString, keyString, nameFromKeyString, rowKeysFromKeyString, s, t, t
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

newPage

public final void newPage(IPage newPage)
Move this table to a new page


page

public final IPage page()
Description copied from interface: ITable
The page to which this table belongs

Specified by:
page in interface ITable

pageType

public final PageType pageType()
Specified by:
pageType in interface ITableType

pageName

public String pageName()
Description copied from interface: ITable
The name of the page on which this table is found

Specified by:
pageName in interface ITable

tableName

public String tableName()
Specified by:
tableName in interface ITableType

toString

public String toString()
Overrides:
toString in class Object

headerRows

public int headerRows()
Description copied from interface: Table
The number of header rows in this table. Must be at least one, but can be more.

Specified by:
headerRows in interface Table

keyTypes

public Class[] keyTypes()
Description copied from interface: Table
The type and number of key columns in this table. There must be at least one key column, and exactly one is common, but it may be more.

If you create a table/object definition with more than one key column, and the uniqueness of the name depends on the key columns after the first, then the name() function should return a concatenation of the key column objects otherwise the lookup() function will fail, the objects which have the same first column value but differ in the others will not be added to the store, as they will appear to be duplicate entries.

See TypeObject.keyString(Object[])

See IRecord.name()

Specified by:
keyTypes in interface Table

colNameObjects

public Object[] colNameObjects()
Description copied from interface: ITableType
Return an array of all column name objects. The order in which they are presented defines the order in which the columns will be written to an output file.

Specified by:
colNameObjects in interface ITableType
Returns:
an array of column name objects

destroy

public void destroy()
Description copied from interface: Table
Called when the table is no longer required, to discard references held in the table, for example to the parent page

Specified by:
destroy in interface Table