org.opengts.dbtools
Class DBTableIndexMap

java.lang.Object
  extended by org.opengts.dbtools.DBTableIndexMap

public class DBTableIndexMap
extends java.lang.Object

DBTableIndexMap is used by DBProvider to hold actual table column to index, and index to column mappings.


Constructor Summary
DBTableIndexMap(java.lang.String utableName)
          Constructor
 
Method Summary
 void addIndexColumn(java.lang.String ndxName, java.lang.String colName)
          Adds the index/column name to this index map
 java.util.Set<java.lang.String> getAlternateIndexes()
          Returns a set of the alternate indexes ("PRIMARY" has been removed).
 java.util.Set<java.lang.String> getColumns()
          Returns a set of all column names defined within any index
 java.util.Set<java.lang.String> getColumnsForIndex(java.lang.String ndxName)
          Gets a set of all column names defined for the specified index
 java.util.Set<java.lang.String> getIndexes()
          Returns a set of all defined indexes (including "PRIMARY" if defined)
 java.util.Set<java.lang.String> getIndexesForColumn(java.lang.String colName)
          Gets a set of all indexes defined for the specified column name
 boolean isEmpty()
          Returns true if no index has been defined for this table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBTableIndexMap

public DBTableIndexMap(java.lang.String utableName)
Constructor

Parameters:
utableName - The untranslated table name for this index map
Method Detail

addIndexColumn

public void addIndexColumn(java.lang.String ndxName,
                           java.lang.String colName)
Adds the index/column name to this index map

Parameters:
ndxName - The index name
colName - The field/column name

getAlternateIndexes

public java.util.Set<java.lang.String> getAlternateIndexes()
Returns a set of the alternate indexes ("PRIMARY" has been removed).

Returns:
A set of the alternate indexes.

getIndexes

public java.util.Set<java.lang.String> getIndexes()
Returns a set of all defined indexes (including "PRIMARY" if defined)

Returns:
A set of all defined indexes.

getIndexesForColumn

public java.util.Set<java.lang.String> getIndexesForColumn(java.lang.String colName)
Gets a set of all indexes defined for the specified column name

Parameters:
colName - The column name
Returns:
A set of all indexes defined for the specified column name, or null if the column is not defined within any index.

getColumns

public java.util.Set<java.lang.String> getColumns()
Returns a set of all column names defined within any index

Returns:
A set of all column names defined within any index

getColumnsForIndex

public java.util.Set<java.lang.String> getColumnsForIndex(java.lang.String ndxName)
Gets a set of all column names defined for the specified index

Parameters:
ndxName - The index name
Returns:
A set of all column names defined for the specified index, or null if the index is not defined for this table.

isEmpty

public boolean isEmpty()
Returns true if no index has been defined for this table

Returns:
True if no index has been defined for this table