planetj.database.fielddescriptors
Class FieldDescriptorCollection

java.lang.Object
  extended byplanetj.database.fielddescriptors.FieldDescriptorCollection

public class FieldDescriptorCollection
extends java.lang.Object


Field Summary
static java.util.Comparator DISPLAY_ORDER_COMPARATOR
           
static java.util.Comparator NAME_COMPARATOR
           
static java.util.Comparator USAGE_ID_COMPARATOR
           
 
Constructor Summary
FieldDescriptorCollection()
          FieldDescriptorCollection constructor comment.
 
Method Summary
 FieldDescriptorRow add(FieldDescriptorRow pFD)
          Sets the Object with the specified key.
 FieldDescriptorRow add(FieldDescriptorRow pFD, boolean pReplace)
          Sets the Object with the specified key.
 FieldDescriptorRow add(TableDescriptor pTD, boolean pReplace)
          Sets the Object with the specified key.
protected  void clearLogicalFieldDescriptorPresent()
           
 java.util.List get(java.lang.Class pFieldClass)
          Returns a List FieldDescriptors with the that has a fieldClass which is equal or a subclass of pFieldClass
 FieldDescriptorRow get(java.lang.String pFieldName)
          Returns the Object keyed by the given object.
 java.util.List getAutoIncrementFieldDescriptors()
          Returns a List containing all the FieldDescriptorRow objects which describe Auto-Increment fields in the table
static FieldDescriptorRow getFieldDescriptorById(int pId)
          Gets a field descriptor by ID
 java.util.Iterator getFieldDescriptors()
          Returns all the FieldDescriptors in an unmodifiable Iterator
 java.util.Iterator getFieldDescriptorsWithUsage()
          Returns an Iterator for all field descriptors that have a usage ID
 java.util.List getFieldDescriptorsWithUsageId(int usageId)
          Create and return a list of field descriptors in this collection that have the given usage id.
 FieldDescriptorRow getFieldDescriptorWithUsageId(int pUsageid)
          Return the FieldDescriptorRow for the Field with the specified usage id.
 java.util.List getFieldNames()
          Returns a List of the Field names for the Table.
 java.util.List getKeyFieldNames()
          Returns a List of the Field names for the Table.
 java.util.List getLogicalFieldNames()
          Returns a List of the Field names for the Table.
 java.util.List getOrderedFieldDescriptors()
          Returns a list of the field descriptors in order they were added to this FieldDescriptorCollection Creation date: (6/3/2002 8:07:16 PM)
 java.util.List getPhysicalFieldNames()
          Returns a List of the Field names for the Table.
 TableDescriptor getTableDescriptor()
          Gets the table descriptor
 java.util.List getTableVariableFieldDescriptors()
          Lists the field descriptors which describe table variable fields..
 FieldDescriptorCollection invalidFieldDescriptors()
          Sets all FieldDescriptors to invalid (or not current).
 boolean isEmpty()
          Returns whether or not there are any FieldDescriptorRows in this FieldDescriptorCollection.
 boolean isLogicalFieldDescriptorPresent()
          Tests if this collection of field descriptors contains one or more field descriptors which describe fields that are not physically present in the database.
 void remove(FieldDescriptorRow fd)
           
 void resetLogicalFieldDescriptorPresent()
          Resets the flag indicating if this field descriptor contains a logical field
protected  void setLogicalFieldDescriptorPresentInternal(java.lang.Boolean value)
          Sets if this collection of field descriptors contains one or more field descriptors which describe fields that are not physically present in the database.
 int size()
          Returns the number of FieldDescriptors in this collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISPLAY_ORDER_COMPARATOR

public static final java.util.Comparator DISPLAY_ORDER_COMPARATOR

NAME_COMPARATOR

public static final java.util.Comparator NAME_COMPARATOR

USAGE_ID_COMPARATOR

public static final java.util.Comparator USAGE_ID_COMPARATOR
Constructor Detail

FieldDescriptorCollection

public FieldDescriptorCollection()
FieldDescriptorCollection constructor comment.

Method Detail

add

public FieldDescriptorRow add(FieldDescriptorRow pFD)
Sets the Object with the specified key.


add

public FieldDescriptorRow add(FieldDescriptorRow pFD,
                              boolean pReplace)
Sets the Object with the specified key.


add

public FieldDescriptorRow add(TableDescriptor pTD,
                              boolean pReplace)
Sets the Object with the specified key.


clearLogicalFieldDescriptorPresent

protected void clearLogicalFieldDescriptorPresent()

get

public java.util.List get(java.lang.Class pFieldClass)
Returns a List FieldDescriptors with the that has a fieldClass which is equal or a subclass of pFieldClass


get

public FieldDescriptorRow get(java.lang.String pFieldName)
Returns the Object keyed by the given object.


getAutoIncrementFieldDescriptors

public java.util.List getAutoIncrementFieldDescriptors()
Returns a List containing all the FieldDescriptorRow objects which describe Auto-Increment fields in the table


getFieldDescriptorById

public static FieldDescriptorRow getFieldDescriptorById(int pId)
                                                 throws CMException
Gets a field descriptor by ID

Parameters:
pId - The id of the FD to get
Throws:
CMException

getFieldDescriptors

public java.util.Iterator getFieldDescriptors()
Returns all the FieldDescriptors in an unmodifiable Iterator


getFieldDescriptorsWithUsage

public java.util.Iterator getFieldDescriptorsWithUsage()
Returns an Iterator for all field descriptors that have a usage ID


getFieldDescriptorsWithUsageId

public java.util.List getFieldDescriptorsWithUsageId(int usageId)
Create and return a list of field descriptors in this collection that have the given usage id.

Parameters:
usageId - usage id to get field descriptors
Returns:
List of FieldDescriptorRows

getFieldDescriptorWithUsageId

public FieldDescriptorRow getFieldDescriptorWithUsageId(int pUsageid)
Return the FieldDescriptorRow for the Field with the specified usage id.

Returns:
FieldDescriptorRow

getFieldNames

public java.util.List getFieldNames()
Returns a List of the Field names for the Table. This may include the names of fields which are not physically present in the database


getKeyFieldNames

public java.util.List getKeyFieldNames()
Returns a List of the Field names for the Table.


getLogicalFieldNames

public java.util.List getLogicalFieldNames()
Returns a List of the Field names for the Table. This will only include the names of fields which are not physically present in the database


getOrderedFieldDescriptors

public java.util.List getOrderedFieldDescriptors()
Returns a list of the field descriptors in order they were added to this FieldDescriptorCollection Creation date: (6/3/2002 8:07:16 PM)


getPhysicalFieldNames

public java.util.List getPhysicalFieldNames()
Returns a List of the Field names for the Table. This will only include the names of fields which are physically present in the database


getTableDescriptor

public TableDescriptor getTableDescriptor()
Gets the table descriptor


getTableVariableFieldDescriptors

public java.util.List getTableVariableFieldDescriptors()
Lists the field descriptors which describe table variable fields.. A table variable field is one whose value may need to be altered when copying a row from one table to another. By default, table variable fields are assumed to be the key fields, as well as any auto-increment fields


invalidFieldDescriptors

public FieldDescriptorCollection invalidFieldDescriptors()
Sets all FieldDescriptors to invalid (or not current). This is used when FDs are updated and we need to force Field's with cached FDs to invalid them.

Returns:
FieldDescriptorCollection

isEmpty

public boolean isEmpty()
Returns whether or not there are any FieldDescriptorRows in this FieldDescriptorCollection.


isLogicalFieldDescriptorPresent

public boolean isLogicalFieldDescriptorPresent()
Tests if this collection of field descriptors contains one or more field descriptors which describe fields that are not physically present in the database.


remove

public void remove(FieldDescriptorRow fd)

resetLogicalFieldDescriptorPresent

public void resetLogicalFieldDescriptorPresent()
Resets the flag indicating if this field descriptor contains a logical field


setLogicalFieldDescriptorPresentInternal

protected final void setLogicalFieldDescriptorPresentInternal(java.lang.Boolean value)
Sets if this collection of field descriptors contains one or more field descriptors which describe fields that are not physically present in the database.


size

public int size()
Returns the number of FieldDescriptors in this collection.