com.ibm.db.base
Class DatabaseCompoundType

java.lang.Object
  |
  +--com.ibm.db.base.DatabaseCompoundType

public class DatabaseCompoundType
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

See Also:
Serialized Form

Field Summary
private static java.lang.String copyright
           
private  OrderedHashtable fields
           
(package private) static long serialVersionUID
           
 
Constructor Summary
DatabaseCompoundType()
          Constructs a new DatabaseCompoundType and initializes its fields.
DatabaseCompoundType(DatabaseCompoundType aType)
          Constructs a new DatabaseCompoundType and initializes its fields to the values of the specified DatabaseCompoundType.
 
Method Summary
 void addField(DatabaseTypeField aField)
          Adds the DatabaseTypeField as a field in the DatabaseCompoundType with the DatabaseTypeField's name as the name.
 void addFieldWithProposedName(DatabaseTypeField typeField)
          Adds the DatabaseTypeField as a field in the DatabaseCompoundType with the proposed name.
protected  java.lang.Object clone()
          This method returns a DatabaseCompoundType which is a clone of itself.
 DatabaseTypeField fieldAt(int colIndex)
          Returns the field in the colIndex position.
 DatabaseTypeField fieldAt(java.lang.String colName)
          Returns the field keyed by colName.
 java.util.Enumeration getColumnNames()
          Returns an enumeration on the keys(colNames) of the ordered hashtable.
private  OrderedHashtable getFields()
          This method returns the ordered hashtable that holds on to the fields
 int indexOfColumnName(java.lang.String aColumnName)
          Returns the position of the field keyed by aColumnName.
static DatabaseTypeField makeField(java.lang.String className)
          Returns a DatabaseTypeField of the appropriate type for the java class name passed as input.
 boolean removeFieldAt(int colIndex)
          Removes the field in the colIndex position.
 void removeFieldAt(java.lang.String colName)
          Removes the field keyed by colName.
private  void setFields(OrderedHashtable aHashTable)
          Sets the ordered hashtable that holds on to the fields.
 int size()
          Returns the number of fields in this instance of DatabaseCompoundType.
 
Methods inherited from class java.lang.Object
, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

fields

private OrderedHashtable fields

serialVersionUID

static final long serialVersionUID

copyright

private static final java.lang.String copyright
Constructor Detail

DatabaseCompoundType

public DatabaseCompoundType()
Constructs a new DatabaseCompoundType and initializes its fields.

DatabaseCompoundType

public DatabaseCompoundType(DatabaseCompoundType aType)
                     throws java.lang.CloneNotSupportedException
Constructs a new DatabaseCompoundType and initializes its fields to the values of the specified DatabaseCompoundType.
Parameters:
aType - a DatabaseCompoundType
Throws:
java.lang.CloneNotSupportedException - if clone is not supported
Method Detail

addField

public void addField(DatabaseTypeField aField)
Adds the DatabaseTypeField as a field in the DatabaseCompoundType with the DatabaseTypeField's name as the name.
Parameters:
aField - a DatabaseTypeField

addFieldWithProposedName

public void addFieldWithProposedName(DatabaseTypeField typeField)
Adds the DatabaseTypeField as a field in the DatabaseCompoundType with the proposed name. If a field already exists with the propesed name, a number is appended to the name and another attempt is made. The number is incremented until an unique name is found.
Parameters:
aField - a DatabaseTypeField

clone

protected java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException
This method returns a DatabaseCompoundType which is a clone of itself.
Overrides:
clone in class java.lang.Object
Returns:
java.lang.Object

fieldAt

public DatabaseTypeField fieldAt(int colIndex)
Returns the field in the colIndex position.

fieldAt

public DatabaseTypeField fieldAt(java.lang.String colName)
Returns the field keyed by colName.

getColumnNames

public java.util.Enumeration getColumnNames()
Returns an enumeration on the keys(colNames) of the ordered hashtable.

getFields

private OrderedHashtable getFields()
This method returns the ordered hashtable that holds on to the fields

indexOfColumnName

public int indexOfColumnName(java.lang.String aColumnName)
Returns the position of the field keyed by aColumnName.

makeField

public static DatabaseTypeField makeField(java.lang.String className)
Returns a DatabaseTypeField of the appropriate type for the java class name passed as input.
Parameters:
className - the name of the Java class
Returns:
a DatabaseTypeField

removeFieldAt

public boolean removeFieldAt(int colIndex)
Removes the field in the colIndex position.

removeFieldAt

public void removeFieldAt(java.lang.String colName)
Removes the field keyed by colName.

setFields

private void setFields(OrderedHashtable aHashTable)
Sets the ordered hashtable that holds on to the fields.
Parameters:
aHashTable - the hashTable

size

public int size()
Returns the number of fields in this instance of DatabaseCompoundType.