ajax.catalog
Class Catalog

java.lang.Object
  |
  +--ajax.catalog.Catalog

public class Catalog
extends java.lang.Object

Catalog stores the schema of tables and the cleaning transformations Each table schema is composed by the table name and the list of attribute names and attribute types


Constructor Summary
Catalog()
          Constructor for the catalog.
 
Method Summary
 void addTable(Table table)
          adds a table to the catalog. verifies if there is already a table defined with the same name if there is, throws an exception.
 void addTransformation(Transformation transf)
          This method add a transformations to the catalog. verifies if there is already one defined with the same name if there is, throws an exception.
 boolean exists(java.lang.String objname)
          checks if a given object exists in the catalog
 CatalogObject getObject(java.lang.String objName)
          looks for a tableName, transfName, functionName or algorithmName in the catalog and returns the corresponding object. if not found it returns null.
 Table getTable(java.lang.String tableName)
          Given a table name this method looks for the corresponding table in the catalog and returns the corresponding table object. if not found it returns null.
 java.util.Enumeration getTablesNames()
          returns the initial tables names defined by the user.
 java.util.List getTransfList()
          Returns the ordered list of transformations
 java.util.List getTransfNamesList()
          Returns an array with the names of the transformations to execute
 Transformation getTransformation(java.lang.String transfName)
          Given a transformation name, this method looks for the corresponding transformation in the catalog and returns the corresponding object. if not found it returns null.
 java.util.Enumeration getTransformations()
          Get transformations
 void removeTable(java.lang.String tableName)
          removes a table from the catalog.
 void removeTransformation(java.lang.String transfName)
          removes a transformation from the catalog.
 java.lang.String toString()
          Convert a catalog to human readable string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Catalog

public Catalog()
Constructor for the catalog.
Method Detail

getTablesNames

public final java.util.Enumeration getTablesNames()
returns the initial tables names defined by the user. These tables contain the data to clean and other auxiliary data used during the cleaning process

addTable

public void addTable(Table table)
              throws CatalogException
adds a table to the catalog. verifies if there is already a table defined with the same name if there is, throws an exception.

removeTable

public void removeTable(java.lang.String tableName)
removes a table from the catalog.
Parameters:
tableName - is the table name.

getTable

public Table getTable(java.lang.String tableName)
Given a table name this method looks for the corresponding table in the catalog and returns the corresponding table object. if not found it returns null.
Parameters:
tablename - is the table name.
Returns:
the corresponding table object.

addTransformation

public void addTransformation(Transformation transf)
                       throws CatalogException
This method add a transformations to the catalog. verifies if there is already one defined with the same name if there is, throws an exception.
Parameters:
view - is the transformation to add.

removeTransformation

public void removeTransformation(java.lang.String transfName)
removes a transformation from the catalog.
Parameters:
transfName - is the table name.

getTransformation

public Transformation getTransformation(java.lang.String transfName)
Given a transformation name, this method looks for the corresponding transformation in the catalog and returns the corresponding object. if not found it returns null.
Parameters:
the - function name.
Returns:
the corresponding function object.

getTransfList

public java.util.List getTransfList()
Returns the ordered list of transformations

getTransfNamesList

public java.util.List getTransfNamesList()
Returns an array with the names of the transformations to execute

getObject

public CatalogObject getObject(java.lang.String objName)
looks for a tableName, transfName, functionName or algorithmName in the catalog and returns the corresponding object. if not found it returns null.
Parameters:
objName - is a name of a catalog object
Returns:
the corresponding object.

exists

public boolean exists(java.lang.String objname)
checks if a given object exists in the catalog
Parameters:
objname - is the Object name we look for.
Returns:
true if the object exists.

getTransformations

public java.util.Enumeration getTransformations()
Get transformations

toString

public java.lang.String toString()
Convert a catalog to human readable string.
Overrides:
toString in class java.lang.Object
Returns:
a string representing the catalog.