com.tivoli.twg.engine
Class TWGDbColumnData

java.lang.Object
  extended bycom.tivoli.twg.engine.TWGDbColumnData

public class TWGDbColumnData
extends java.lang.Object


Constructor Summary
TWGDbColumnData()
          Constructor for TWGDbColumnData
 
Method Summary
 void addColumn(TWGDbColumn column)
          Add a column.
 int columnSize()
          Get number of columns in the table.
 TWGDbColumn getColumn(java.lang.String token)
          Get a column by its token name
 TWGDbColumn getColumnByColumnRealName(java.lang.String realName)
          Get a column by its real name
 int getColumnId(java.lang.String token)
          Get the id number for a column.
 java.util.Enumeration getColumnIds()
          Get all the column numbers.
 java.lang.Integer getColumnLength(java.lang.String token)
          Get the number of characters in a CHAR type column by its token name.
 java.util.Vector getColumnLengths()
          Get the number of characters in each column.
 java.util.Enumeration getColumns()
          Get a list of TWGDbColumn objects for all the columns in a table.
 int getColumnType(java.lang.String token)
          Get the type of a column by its token name.
 java.util.Vector getColumnTypes()
          Gets a list of column data types in the TWGDbColumnData object.
 java.lang.Object getDefaultValue(java.lang.String token)
          Get a column default value by its token name.
 java.util.Vector getDefaultValues()
          Method to get the default values for each column.
 java.lang.String getDisplayName(java.lang.String token)
          Get the display name of a column by its token name.
 java.util.Vector getFilterColumns(java.util.Locale loc, TWGDatabaseTable table)
          Get a vector of all the columns that are filter columns.
 boolean getKey(java.lang.String token)
          Check whether a column is part of key.
 int getKeyNum(java.lang.String token)
          Get the number this column is in the key.
 java.util.Vector getKeys()
          Get a list of column names that make up the key.
 java.lang.String getRealColumnName(java.lang.String token)
          Get the real name of a column by its token name.
 java.util.Vector getRealColumnNames()
          Get a list of all the real column names.
 java.util.Vector getTokenColumnNames()
          Get a list of all column token names.
 java.lang.String getTokenForId(int columnId)
          Get the column token name by its column number.
 java.lang.String getTokenForId(java.lang.Integer columnId)
          Get the column token name by its column id number.
 java.util.Enumeration getTokens()
          Get all the column token names for a table.
 boolean isFilterColumn(java.lang.String token)
          Is the column selectable on the edit dynamic group (filter) panel?
 boolean isMappedColumn(java.lang.String token)
          Are the column values mapped to translated values for queries?
 void removeColumn(java.lang.String token)
          Deprecated.  
protected  void setKeyNum(java.lang.String token, int keyNum)
          This method is protected as an implementation side effect.
 java.lang.String toString()
          Convert ColumnData to String for debug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TWGDbColumnData

public TWGDbColumnData()
Constructor for TWGDbColumnData

Method Detail

getColumns

public java.util.Enumeration getColumns()
Get a list of TWGDbColumn objects for all the columns in a table.

Returns:
the enumeration of column objects

getTokens

public java.util.Enumeration getTokens()
Get all the column token names for a table.

Returns:
an enumeration of the column token names

getColumnIds

public java.util.Enumeration getColumnIds()
Get all the column numbers.

Returns:
an enumeration of id numbers for the columns

addColumn

public void addColumn(TWGDbColumn column)
Add a column.

Parameters:
column - - the column to be added.
See Also:
TWGDbColumn

removeColumn

public void removeColumn(java.lang.String token)
                  throws TWGDbException
Deprecated.  

This method is obsolete and should not be used

Parameters:
token -
Throws:
TWGDbException

columnSize

public int columnSize()
Get number of columns in the table.

Returns:
the number of columns

getColumn

public TWGDbColumn getColumn(java.lang.String token)
                      throws TWGDbException
Get a column by its token name

Parameters:
token - - column token nmae
Returns:
the column
Throws:
TWGDbException - if column is not found
See Also:
TWGDbColumn

getColumnByColumnRealName

public TWGDbColumn getColumnByColumnRealName(java.lang.String realName)
                                      throws TWGDbException
Get a column by its real name

Parameters:
realName - - column real nmae
Returns:
the column
Throws:
TWGDbException - if column is not found
See Also:
TWGDbColumn

getColumnType

public int getColumnType(java.lang.String token)
                  throws TWGDbException
Get the type of a column by its token name.

Parameters:
token - - column token name
Returns:
the column type. Valid values are defined in TWGDatabaseConstants
Throws:
TWGDbException
See Also:
TWGDatabaseConstants

getRealColumnName

public java.lang.String getRealColumnName(java.lang.String token)
                                   throws TWGDbException
Get the real name of a column by its token name.

Parameters:
token - - column token name
Returns:
the real column name
Throws:
TWGDbException - if the column is not found

getDisplayName

public java.lang.String getDisplayName(java.lang.String token)
                                throws TWGDbException
Get the display name of a column by its token name. The display name is valid only when an IPC request is issued to get table descriptive information and the column subclasses contained in this object have been sent through the IPC in response to this request.

Parameters:
token - - column token name
Returns:
the display column name, or null if display name not valid
Throws:
TWGDbException - if the column is not found

getColumnLength

public java.lang.Integer getColumnLength(java.lang.String token)
                                  throws TWGDbException
Get the number of characters in a CHAR type column by its token name.

Parameters:
token - - column token name
Returns:
the length. For columns that are not CHAR or VARCHAR, the length is 0.
Throws:
TWGDbException - if the column is not found

getDefaultValue

public java.lang.Object getDefaultValue(java.lang.String token)
                                 throws TWGDbException
Get a column default value by its token name.

Parameters:
token - - column token name
Returns:
the default value as an Object (e.g. Integer for an integer column)
Throws:
TWGDbException - if the column is not found

getKey

public boolean getKey(java.lang.String token)
               throws TWGDbException
Check whether a column is part of key.

Parameters:
token - - column token name
Returns:
true if column is part of the key, otherwise fales
Throws:
TWGDbException - if the column is not found

getColumnId

public int getColumnId(java.lang.String token)
                throws TWGDbException
Get the id number for a column.

Parameters:
token - - column token name
Returns:
the column number
Throws:
TWGDbException - if the column is not found

getTokenForId

public java.lang.String getTokenForId(java.lang.Integer columnId)
Get the column token name by its column id number.

Parameters:
columnId - - column number
Returns:
the token name. If the column id number is not found return null.

getTokenForId

public java.lang.String getTokenForId(int columnId)
Get the column token name by its column number.

Parameters:
columnId - - column number
Returns:
the token name. If the column id number is not found return null.

getKeyNum

public int getKeyNum(java.lang.String token)
              throws TWGDbException
Get the number this column is in the key. If the column isn't part of the key, return 0. This field is not valid until the table has been initialized.

Parameters:
token - - column token name
Returns:
the key number
Throws:
TWGDbException - if the column is not found

setKeyNum

protected void setKeyNum(java.lang.String token,
                         int keyNum)
                  throws TWGDbException
This method is protected as an implementation side effect. Do not call or change. Its interface may be changed in a later release.

Set the number in key. If the column isn't part of the key, set 0.

Parameters:
token - - column token name
keyNum - - key number, or 0 if column is not in the key
Throws:
TWGDbException - if the column is not found

isFilterColumn

public boolean isFilterColumn(java.lang.String token)
                       throws TWGDbException
Is the column selectable on the edit dynamic group (filter) panel?

Parameters:
token - - column token name
Returns:
true for filter columns, otherwise false
Throws:
TWGDbException - if the column is not found

isMappedColumn

public boolean isMappedColumn(java.lang.String token)
                       throws TWGDbException
Are the column values mapped to translated values for queries?

Parameters:
token - - column token name
Returns:
true if mapped, otherwise false
Throws:
TWGDbException - if the column is not found

getColumnTypes

public java.util.Vector getColumnTypes()
                                throws TWGDbException
Gets a list of column data types in the TWGDbColumnData object. They are in the same order as they were defined when the table was created. Valid types are defined in TWGDatabaseConstants.

Returns:
a vector of column types as Integers.
Throws:
TWGDbException
See Also:
TWGDatabaseConstants

getRealColumnNames

public java.util.Vector getRealColumnNames()
                                    throws TWGDbException
Get a list of all the real column names. They are in the same order as they were defined when the table was created.

Returns:
Vector of real column names
Throws:
TWGDbException

getTokenColumnNames

public java.util.Vector getTokenColumnNames()
                                     throws TWGDbException
Get a list of all column token names. They are in the same order as they were defined when the table was created.

Returns:
Vector of column token names
Throws:
TWGDbException

getColumnLengths

public java.util.Vector getColumnLengths()
                                  throws TWGDbException
Get the number of characters in each column. They are in the same order as they were defined when the table was created.

Returns:
Vector of Integers for the length of each column
Throws:
TWGDbException

getFilterColumns

public java.util.Vector getFilterColumns(java.util.Locale loc,
                                         TWGDatabaseTable table)
                                  throws TWGDbException
Get a vector of all the columns that are filter columns. They are in the same order as they were defined when the table was created.

Parameters:
loc - - the Locale for translating
table - - a reference to the table
Returns:
A vector of filter columns ( all subclasses of TWGDbColumn)
Throws:
TWGDbException

getDefaultValues

public java.util.Vector getDefaultValues()
                                  throws TWGDbException
Method to get the default values for each column. They are in the same order as they were defined when the table was created.

Returns:
Vector of default values as Objects.
Throws:
TWGDbException

getKeys

public java.util.Vector getKeys()
Get a list of column names that make up the key.

Returns:
Vector of key column names

toString

public java.lang.String toString()
Convert ColumnData to String for debug

Returns:
String with a textual description of each column.